[Mono-bugs] [Bug 642930] New: Inconsistent bahavior of Transaction.TransactionInformation between mono and .net

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Sep 30 14:21:23 EDT 2010


https://bugzilla.novell.com/show_bug.cgi?id=642930

https://bugzilla.novell.com/show_bug.cgi?id=642930#c0


           Summary: Inconsistent bahavior of
                    Transaction.TransactionInformation between mono and
                    .net
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Core
        AssignedTo: jbevain at novell.com
        ReportedBy: pruiz at netway.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.63 Safari/534.3

When accessing 'System.Transactions.Transaction.Current.TransactionInformation'
before 'completing' a transaction scope, if running on mono a
InvalidOperationException get's thrown, while the call works successfully on
net.

Here it's a sample code demostrating the issue:


using System;
using System.Transactions;


class MainClass {
        static void Main()
        {
                using (var ts = new TransactionScope())
                {
                        var tr = Transaction.Current;
                        ts.Complete();
                        var ti = tr.TransactionInformation;
                        Console.WriteLine("status == {0}", ti.Status);
                }
        }
}


And the error when executed on mono:


Unhandled Exception: System.InvalidOperationException: The current
TransactionScope is already complete
  at System.Transactions.Transaction.EnsureIncompleteCurrentScope () [0x00000]
in <filename unknown>:0
  at System.Transactions.Transaction.get_TransactionInformation () [0x00000] in
<filename unknown>:0
  at MainClass.Main () [0x00000] in <filename unknown>:0



Reproducible: Always

Steps to Reproduce:
1. Compile sample code with: gmcs -out:ts.exe -target:exe
-reference:System.Transactions ts.cs
2. Run mono ts.exe
3. See exception..
Actual Results:  
Unhandled Exception: System.InvalidOperationException: The current
TransactionScope is already complete
  at System.Transactions.Transaction.EnsureIncompleteCurrentScope () [0x00000]
in <filename unknown>:0
  at System.Transactions.Transaction.get_TransactionInformation () [0x00000] in
<filename unknown>:0
  at MainClass.Main () [0x00000] in <filename unknown>:0


Expected Results:  
Console output:

status == Active

Tested against git's master and 2.8 branches.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list