From: Michael D. <mik...@us...> - 2004-09-15 03:17:57
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Transaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31747/Transaction Modified Files: Transaction.cs Log Message: Moved code for an IDbCommand to enlist in a Transaction to the Transaction class. Index: Transaction.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Transaction/Transaction.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Transaction.cs 28 Aug 2004 04:07:05 -0000 1.3 --- Transaction.cs 15 Sep 2004 03:17:47 -0000 1.4 *************** *** 32,35 **** --- 32,61 ---- } + public void Enlist(IDbCommand command) + { + if( trans==null ) + { + if(command.Transaction!=null) + { + log.Warn("set a nonnull IDbCommand.Transaction to null because the Session had no Transaction"); + } + command.Transaction = null; + return; + } + else + { + + // got into here because the command was being initialized and had a null Transaction - probably + // don't need to be confused by that - just a normal part of initialization... + if(command.Transaction!=null) + { + log.Warn("The IDbCommand had a different Transaction than the Session. This can occur when " + + "Disconnecting and Reconnecting Sessions because the PreparedCommand Cache is Session specific."); + } + + command.Transaction = trans; + } + } + public void Begin() { |