From: Michael D. <mik...@us...> - 2005-01-30 19:36:27
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32147/NHibernate/Impl Modified Files: SessionFactoryImpl.cs SessionImpl.cs Log Message: Implemented IDisposable according to standard .net pattern Added some more xml comments to Connection namespace. Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** SessionImpl.cs 24 Jan 2005 03:41:47 -0000 1.61 --- SessionImpl.cs 30 Jan 2005 19:36:16 -0000 1.62 *************** *** 4056,4078 **** log.Debug( "running ISession.Dispose()" ); Dispose( true ); - - // // it was never disconnected - // if( connection != null ) - // { - // AfterTransactionCompletion(); - // - // if( connection.State == ConnectionState.Closed ) - // { - // log.Warn( "finalizing unclosed session with closed connection" ); - // } - // else - // { - // log.Warn( "unclosed connection" ); - // if( autoClose ) - // { - // connection.Close(); - // } - // } - // } } --- 4056,4059 ---- *************** *** 4106,4110 **** AfterTransactionCompletion(); } - //TODO: add a Dispose to IBatcher (NDataReader), & ITransaction // if the Session is responsible for managing the connection then make sure --- 4087,4090 ---- *************** *** 4118,4121 **** --- 4098,4111 ---- } + if( transaction!=null ) + { + transaction.Dispose(); + } + + if( batcher!=null ) + { + // TODO: add batcher.Dispose() when IDisposable implemented by IBatcher + } + // it is important to call Cleanup because that marks the Session as being // closed - the Session could still be associated with a Proxy that is attempting Index: SessionFactoryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** SessionFactoryImpl.cs 24 Jan 2005 03:31:45 -0000 1.39 --- SessionFactoryImpl.cs 30 Jan 2005 19:36:15 -0000 1.40 *************** *** 790,794 **** try { ! ConnectionProvider.Close(); } finally --- 790,794 ---- try { ! ConnectionProvider.Dispose(); } finally |