From:
<car...@te...> - 2004-08-24 18:57:22
|
Hello: >Yes I am. It is version 1.6.1.0, freshly compiled from CVS today. > >Basically, I do the following : > >System.Data.IDbCommand command = ... >command.Transaction = connection.BeginTransaction > (IsolationLevel.RepeatableRead); > >...work... > >command.Transaction.Rollback (); >command.Transaction.Dispose (); <--- crash, null reference exception > >Does this give you any hints ? > In the 1.6+ when you do a rollback the transaction property of the commands that have that transaction will be set to null,, hummm, it's easy to fix you will need simply to use a different object for the transaction but in any case i will try to review how the SqlClient manages this. Here is my test case: [Test] public void DisposeTest() { FbCommand cmd = new FbCommand("select * from test", this.Connection); cmd.Transaction = this.Connection.BeginTransaction(IsolationLevel.RepeatableRead); FbDataReader r = cmd.ExecuteReader(); while (r.Read()) { } r.Close(); cmd.Transaction.Rollback(); cmd.Transaction.Dispose(); } -- Best regards Carlos Guzmán Álvarez Vigo-Spain One ring to rule them all (The lord of the rings - J.R.R.Tolkien) |