[Mono-bugs] [Bug 44990][Nor] New - SqlTransaction.Dispose throws an exception on Dispose when the transaction is not open.

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Tue, 17 Jun 2003 11:27:45 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by tom@acquist.com.

http://bugzilla.ximian.com/show_bug.cgi?id=44990

--- shadow/44990	Tue Jun 17 11:27:45 2003
+++ shadow/44990.tmp.29995	Tue Jun 17 11:27:45 2003
@@ -0,0 +1,48 @@
+Bug#: 44990
+Product: Mono/Class Libraries
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System.Data.SqlClient
+AssignedTo: rodrigo@ximian.com                            
+ReportedBy: tom@acquist.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: SqlTransaction.Dispose throws an exception on Dispose when the transaction is not open.
+
+Description of Problem:
+SqlTransaction.Dispose will throw an InvalidOperationException with the 
+message "The Transaction was not open." when it is called if the 
+transaction has already been closed.
+
+
+Steps to reproduce the problem:
+1.  Create a transaction.
+2.  Call transaction.Close();
+3.  Call transaction.Dispose();
+
+Actual Results:
+
+InvalidOperationException with the message "The Transaction was not 
+open.", originating from SqlTransaction.Rollback(string);
+
+
+Expected Results:
+Dispose should silently do nothing.  If the transaction is not open, 
+there's no cleanup it needs to do.
+
+
+How often does this happen? 
+Always.
+
+
+Additional Information:
+SqlTransaction.Dispose is calling Rollback() every time when disposing == 
+true.  Rollback() should only get called when disposing == true && isOpen 
+== false.