From: <pa...@us...> - 2011-03-27 00:18:31
|
Revision: 5546 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5546&view=rev Author: patearl Date: 2011-03-27 00:18:24 +0000 (Sun, 27 Mar 2011) Log Message: ----------- Improved compatibility of transaction handling across databases. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Transaction/AdoTransaction.cs Modified: trunk/nhibernate/src/NHibernate/Transaction/AdoTransaction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Transaction/AdoTransaction.cs 2011-03-26 19:41:34 UTC (rev 5545) +++ trunk/nhibernate/src/NHibernate/Transaction/AdoTransaction.cs 2011-03-27 00:18:24 UTC (rev 5546) @@ -75,6 +75,9 @@ } log.Debug("Enlist Command"); + // If you try to assign a disposed transaction to a command with MSSQL, it will leave the command's + // transaction as null and not throw an error. With SQLite, for example, it will throw an exception + // here instead. Because of this, we set the trans field to null in when Dispose is called. command.Transaction = trans; } } @@ -363,6 +366,7 @@ if (trans != null) { trans.Dispose(); + trans = null; log.Debug("IDbTransaction disposed."); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |