8

I've enabled System.Transactions logging:

<system.diagnostics>
    <sources>
        <source name="System.Transactions" switchValue="Warning">
            -- my listeners here
        </source>
    </sources>
</system.diagnostics>

and see A LOT of strange log warnings like:

  • Transaction.Rollback Called
  • Enlistment Callback Negative
  • TransactionScope Incomplete

Can please somebody shed some light on it? My system works as expected and there are no ADO.NET level exceptions raised. The DAL code is typical L2S code without explicit transaction management or any hacks.

UserControl
  • 14,766
  • 20
  • 100
  • 187
  • 2
    You could use the SQL Profiler to see what SQL is sent to the server so you'll be more informed about what is going on. Without more information it is very hard for us to give an answer. – Emond Oct 10 '12 at 14:40
  • I monitored the profiler output and saw no criminal. I think SQL statements generated have nothing to do with the issue because even if SQL server caused some warnings they couldn't propagate back to managed code, could they? – UserControl Oct 10 '12 at 14:53
  • It depends (as always) are these warning triggered by the database or by the .NET code/L2S? If they are caused by the database you should check the batches/procedures that are executed there. (I do think they have to be propagated to the client) – Emond Oct 10 '12 at 15:02
  • 2
    It may be some other process or third party library in context of your app, Transaction may be for something else, e.g. visual studio editor for ui designer also works in transaction, so many of internal library or process may be working in transaction, what kind of app is it? Desktop, service or asp.net? – Akash Kava Oct 12 '12 at 21:15
  • 1
    I'm just doing wild speculation here-- maybe System.Transaction thought a transaction was going to start, but then it didn't. TransactionScope seems to be an API that is trying read the mind of the developer. Also, try bumping the switchValue to Verbose to get a more complete store & try adding some trace output to your own code to get a more complete story (i.e. what events in your code do the warnings clump with?) – MatthewMartin Oct 24 '12 at 13:17
  • @Akash Kava, it's WCF application. – UserControl Oct 24 '12 at 13:33

1 Answers1

1

Using a switchValue of Warning will pickup more than just errors. From msdn:

A condition exists that can subsequently result in an error or critical failure (for example, allocation failing or approaching a limit). Normal processing of errors from user code (for example, transaction aborted, timeouts, authentication failed) can also generate a warning.

Maybe this is what you want. If so, cool. Otherwise, you may want to change it to Error.

Anderson
  • 134
  • 1
  • 1
  • 6