You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(248) |
May
(82) |
Jun
(90) |
Jul
(177) |
Aug
(253) |
Sep
(157) |
Oct
(151) |
Nov
(143) |
Dec
(278) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(152) |
Feb
(107) |
Mar
(177) |
Apr
(133) |
May
(259) |
Jun
(81) |
Jul
(119) |
Aug
(306) |
Sep
(416) |
Oct
(240) |
Nov
(329) |
Dec
(206) |
2006 |
Jan
(466) |
Feb
(382) |
Mar
(153) |
Apr
(162) |
May
(133) |
Jun
(21) |
Jul
(18) |
Aug
(37) |
Sep
(97) |
Oct
(114) |
Nov
(110) |
Dec
(28) |
2007 |
Jan
(74) |
Feb
(65) |
Mar
(49) |
Apr
(76) |
May
(43) |
Jun
(15) |
Jul
(68) |
Aug
(55) |
Sep
(63) |
Oct
(59) |
Nov
(70) |
Dec
(66) |
2008 |
Jan
(71) |
Feb
(60) |
Mar
(120) |
Apr
(31) |
May
(48) |
Jun
(81) |
Jul
(107) |
Aug
(51) |
Sep
(80) |
Oct
(83) |
Nov
(83) |
Dec
(79) |
2009 |
Jan
(83) |
Feb
(110) |
Mar
(97) |
Apr
(91) |
May
(291) |
Jun
(250) |
Jul
(197) |
Aug
(58) |
Sep
(54) |
Oct
(122) |
Nov
(68) |
Dec
(34) |
2010 |
Jan
(50) |
Feb
(17) |
Mar
(63) |
Apr
(61) |
May
(84) |
Jun
(81) |
Jul
(138) |
Aug
(144) |
Sep
(78) |
Oct
(26) |
Nov
(30) |
Dec
(61) |
2011 |
Jan
(33) |
Feb
(35) |
Mar
(166) |
Apr
(221) |
May
(109) |
Jun
(76) |
Jul
(27) |
Aug
(37) |
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(1) |
2014 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael D. <mik...@us...> - 2005-01-30 19:39:22
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv308/NHibernate/Dialect Modified Files: DB2Dialect.cs MySQLDialect.cs Oracle9Dialect.cs PostgreSQLDialect.cs Log Message: Parameter classes are now immutable. All values must be set in the ctor. Index: PostgreSQLDialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PostgreSQLDialect.cs 17 Jan 2005 22:31:48 -0000 1.14 --- PostgreSQLDialect.cs 30 Jan 2005 19:39:11 -0000 1.15 *************** *** 133,144 **** public override SqlString GetLimitString( SqlString querySqlString ) { ! Parameter p1 = new Parameter(); ! Parameter p2 = new Parameter(); ! ! p1.Name = "p1"; ! p1.SqlType = new Int16SqlType(); ! ! p2.Name = "p2"; ! p2.SqlType = new Int16SqlType(); SqlStringBuilder pagingBuilder = new SqlStringBuilder(); --- 133,138 ---- public override SqlString GetLimitString( SqlString querySqlString ) { ! Parameter p1 = new Parameter( "p1", new Int16SqlType() ); ! Parameter p2 = new Parameter( "p2", new Int16SqlType() ); SqlStringBuilder pagingBuilder = new SqlStringBuilder(); Index: Oracle9Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Oracle9Dialect.cs 17 Jan 2005 22:31:48 -0000 1.19 --- Oracle9Dialect.cs 30 Jan 2005 19:39:11 -0000 1.20 *************** *** 154,165 **** public override SqlString GetLimitString( SqlString querySqlString ) { ! Parameter p1 = new Parameter(); ! Parameter p2 = new Parameter(); ! ! p1.Name = "p1"; ! p1.SqlType = new Int16SqlType(); ! ! p2.Name = "p2"; ! p2.SqlType = new Int16SqlType(); /* --- 154,159 ---- public override SqlString GetLimitString( SqlString querySqlString ) { ! Parameter p1 = new Parameter( "p1", new Int16SqlType() ); ! Parameter p2 = new Parameter( "p2", new Int16SqlType() ); /* Index: DB2Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/DB2Dialect.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DB2Dialect.cs 17 Jan 2005 22:31:45 -0000 1.8 --- DB2Dialect.cs 30 Jan 2005 19:39:11 -0000 1.9 *************** *** 146,155 **** public override SqlString GetLimitString( SqlString querySqlString ) { ! Parameter p1 = new Parameter(); ! Parameter p2 = new Parameter(); ! p1.Name = "p1"; ! p1.SqlType = new Int16SqlType(); ! p2.Name = "p2"; ! p2.SqlType = new Int16SqlType(); /* * "select * from (select row_number() over(orderby_clause) as rownum, " --- 146,152 ---- public override SqlString GetLimitString( SqlString querySqlString ) { ! Parameter p1 = new Parameter( "p1", new Int16SqlType() ); ! Parameter p2 = new Parameter( "p2", new Int16SqlType() ); ! /* * "select * from (select row_number() over(orderby_clause) as rownum, " Index: MySQLDialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/MySQLDialect.cs,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** MySQLDialect.cs 17 Jan 2005 22:31:48 -0000 1.24 --- MySQLDialect.cs 30 Jan 2005 19:39:11 -0000 1.25 *************** *** 140,151 **** public override SqlString GetLimitString( SqlString querySqlString ) { ! Parameter p1 = new Parameter(); ! Parameter p2 = new Parameter(); ! ! p1.Name = "p1"; ! p1.SqlType = new Int32SqlType(); ! ! p2.Name = "p2"; ! p2.SqlType = new Int32SqlType(); SqlStringBuilder pagingBuilder = new SqlStringBuilder(); --- 140,145 ---- public override SqlString GetLimitString( SqlString querySqlString ) { ! Parameter p1 = new Parameter( "p1", new Int32SqlType() ); ! Parameter p2 = new Parameter( "p2", new Int32SqlType() ); SqlStringBuilder pagingBuilder = new SqlStringBuilder(); |
From: Michael D. <mik...@us...> - 2005-01-30 19:39:21
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv308/NHibernate/Hql Modified Files: WhereParser.cs Log Message: Parameter classes are now immutable. All values must be set in the ctor. Index: WhereParser.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql/WhereParser.cs,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** WhereParser.cs 31 Dec 2004 18:22:14 -0000 1.27 --- WhereParser.cs 30 Jan 2005 19:39:12 -0000 1.28 *************** *** 481,485 **** { q.AddNamedParameter( token.Substring( 1 ) ); ! AppendToken( q, new SqlString( new object[ ] {new Parameter()} ) ); } else if( token.Equals( StringHelper.SqlParameter ) ) --- 481,488 ---- { q.AddNamedParameter( token.Substring( 1 ) ); ! // this is only a temporary parameter to help with the parsing of hql - ! // when the type becomes known then this will be converted to its real ! // parameter type. ! AppendToken( q, new SqlString( new object[ ] {new Parameter( StringHelper.SqlParameter )} ) ); } else if( token.Equals( StringHelper.SqlParameter ) ) *************** *** 487,491 **** //if the token is a "?" then we have a Parameter so convert it to a SqlCommand.Parameter // instead of appending a "?" to the WhereTokens ! q.AppendWhereToken( new SqlString( new object[ ] {new Parameter()} ) ); } else --- 490,494 ---- //if the token is a "?" then we have a Parameter so convert it to a SqlCommand.Parameter // instead of appending a "?" to the WhereTokens ! q.AppendWhereToken( new SqlString( new object[ ] {new Parameter( StringHelper.SqlParameter)} ) ); } else |
From: Michael D. <mik...@us...> - 2005-01-30 19:37:24
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Tool/hbm2ddl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32412/NHibernate/Tool/hbm2ddl Modified Files: SchemaExport.cs Log Message: Connection provider now gets Disposed instead of Closed. Index: SchemaExport.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Tool/hbm2ddl/SchemaExport.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** SchemaExport.cs 31 Dec 2004 22:39:53 -0000 1.13 --- SchemaExport.cs 30 Jan 2005 19:37:14 -0000 1.14 *************** *** 248,252 **** { connectionProvider.CloseConnection( connection ); ! connectionProvider.Close(); } } --- 248,252 ---- { connectionProvider.CloseConnection( connection ); ! connectionProvider.Dispose(); } } |
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 |
From: Michael D. <mik...@us...> - 2005-01-30 19:36:27
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Transaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32147/NHibernate/Transaction Modified Files: AdoTransaction.cs Log Message: Implemented IDisposable according to standard .net pattern Added some more xml comments to Connection namespace. Index: AdoTransaction.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Transaction/AdoTransaction.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AdoTransaction.cs 23 Jan 2005 15:41:03 -0000 1.1 --- AdoTransaction.cs 30 Jan 2005 19:36:16 -0000 1.2 *************** *** 7,11 **** { /// <summary> ! /// Wraps an ADO.NET transaction to implements the <c>ITransaction</c> interface /// </summary> public class AdoTransaction : ITransaction --- 7,12 ---- { /// <summary> ! /// Wraps an ADO.NET <see cref="IDbTransaction"/> to implement ! /// the <see cref="ITransaction" /> interface. /// </summary> public class AdoTransaction : ITransaction *************** *** 19,25 **** /// <summary> ! /// /// </summary> ! /// <param name="session"></param> public AdoTransaction( ISessionImplementor session ) { --- 20,26 ---- /// <summary> ! /// Initializes a new instance of the <see cref="AdoTransaction"/> class. /// </summary> ! /// <param name="session">The <see cref="ISessionImplementor"/> the Transaction is for.</param> public AdoTransaction( ISessionImplementor session ) { *************** *** 28,34 **** /// <summary> ! /// /// </summary> ! /// <param name="command"></param> public void Enlist( IDbCommand command ) { --- 29,40 ---- /// <summary> ! /// Enlist the <see cref="IDbCommand"/> in the current <see cref="ITransaction"/>. /// </summary> ! /// <param name="command">The <see cref="IDbCommand"/> to enlist in this Transaction.</param> ! /// <remarks> ! /// This takes care of making sure the <see cref="IDbCommand"/>'s Transaction property ! /// contains the correct <see cref="IDbTransaction"/> or <c>null</c> if there is no ! /// Transaction for the ISession - ie <c>BeginTransaction()</c> not called. ! /// </remarks> public void Enlist( IDbCommand command ) { *************** *** 63,67 **** } ! /// <summary></summary> public void Begin() { --- 69,80 ---- } ! /// <summary> ! /// Begins the <see cref="IDbTransaction"/> on the <see cref="IDbConnection"/> ! /// used by the <see cref="ISession"/>. ! /// </summary> ! /// <exception cref="TransactionException"> ! /// Thrown if there is any problems encountered while trying to create ! /// the <see cref="IDbTransaction"/>. ! /// </exception> public void Begin() { *************** *** 89,93 **** } ! /// <summary></summary> public void Commit() { --- 102,113 ---- } ! /// <summary> ! /// Commits the <see cref="ITransaction"/> by flushing the <see cref="ISession"/> ! /// and committing the <see cref="IDbTransaction"/>. ! /// </summary> ! /// <exception cref="TransactionException"> ! /// Thrown if there is any exception while trying to call <c>Commit()</c> on ! /// the underlying <see cref="IDbTransaction"/>. ! /// </exception> public void Commit() { *************** *** 122,126 **** } ! /// <summary></summary> public void Rollback() { --- 142,153 ---- } ! /// <summary> ! /// Rolls back the <see cref="ITransaction"/> by calling the method <c>Rollback</c> ! /// on the underlying <see cref="IDbTransaction"/>. ! /// </summary> ! /// <exception cref="TransactionException"> ! /// Thrown if there is any exception while trying to call <c>Rollback()</c> on ! /// the underlying <see cref="IDbTransaction"/>. ! /// </exception> public void Rollback() { *************** *** 147,151 **** } ! /// <summary></summary> public bool WasRolledBack { --- 174,184 ---- } ! /// <summary> ! /// Gets a <see cref="Boolean"/> indicating if the transaction was rolled back. ! /// </summary> ! /// <value> ! /// <c>true</c> if the <see cref="IDbTransaction"/> had <c>Rollback</c> called ! /// without any exceptions. ! /// </value> public bool WasRolledBack { *************** *** 153,157 **** } ! /// <summary></summary> public bool WasCommitted { --- 186,196 ---- } ! /// <summary> ! /// Gets a <see cref="Boolean"/> indicating if the transaction was committed. ! /// </summary> ! /// <value> ! /// <c>true</c> if the <see cref="IDbTransaction"/> had <c>Commit</c> called ! /// without any exceptions. ! /// </value> public bool WasCommitted { *************** *** 159,162 **** --- 198,262 ---- } + #region System.IDisposable Members + + /// <summary> + /// A flag to indicate if <c>Disose()</c> has been called. + /// </summary> + private bool _isAlreadyDisposed; + + /// <summary> + /// Finalizer that ensures the object is correctly disposed of. + /// </summary> + ~AdoTransaction() + { + Dispose( false ); + } + + /// <summary> + /// Takes care of freeing the managed and unmanaged resources that + /// this class is responsible for. + /// </summary> + public void Dispose() + { + log.Debug( "running AdoTransaction.Dispose()" ); + Dispose( true ); + } + + /// <summary> + /// Takes care of freeing the managed and unmanaged resources that + /// this class is responsible for. + /// </summary> + /// <param name="isDisposing">Indicates if this AdoTransaction is being Disposed of or Finalized.</param> + /// <remarks> + /// If this AdoTransaction is being Finalized (<c>isDisposing==false</c>) then make sure not + /// to call any methods that could potentially bring this AdoTransaction back to life. + /// </remarks> + protected virtual void Dispose(bool isDisposing) + { + if( _isAlreadyDisposed ) + { + // don't dispose of multiple times. + return; + } + + // free managed resources that are being managed by the AdoTransaction if we + // know this call came through Dispose() + if( isDisposing ) + { + if( trans!=null ) + { + trans.Dispose(); + } + } + + // free unmanaged resources here + + _isAlreadyDisposed = true; + // nothing for Finalizer to do - so tell the GC to ignore it + GC.SuppressFinalize( this ); + + } + #endregion + } } \ No newline at end of file |
From: Michael D. <mik...@us...> - 2005-01-30 19:36:26
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32147/NHibernate/Connection Modified Files: ConnectionProvider.cs DriverConnectionProvider.cs IConnectionProvider.cs UserSuppliedConnectionProvider.cs Log Message: Implemented IDisposable according to standard .net pattern Added some more xml comments to Connection namespace. Index: IConnectionProvider.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection/IConnectionProvider.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** IConnectionProvider.cs 31 Dec 2004 16:46:43 -0000 1.6 --- IConnectionProvider.cs 30 Jan 2005 19:36:15 -0000 1.7 *************** *** 1,2 **** --- 1,3 ---- + using System; using System.Collections; using System.Data; *************** *** 6,26 **** { /// <summary> ! /// A strategy for obtaining ADO.NET connections. /// </summary> /// <remarks> /// The <c>IConnectionProvider</c> interface is not intended to be exposed to the application. ! /// Instead it is used internally by Hibernate to obtain connections. Implementors should provide ! /// a public default constructor. /// </remarks> ! public interface IConnectionProvider { /// <summary> - /// The Driver this ConnectionProvider should use to communicate with the .NET Data Provider - /// </summary> - /// <value></value> - /// <remarks></remarks> - IDriver Driver { get; } - - /// <summary> /// Initialize the connection provider from the given properties. /// </summary> --- 7,20 ---- { /// <summary> ! /// A strategy for obtaining ADO.NET <see cref="IDbConnection"/>. /// </summary> /// <remarks> /// The <c>IConnectionProvider</c> interface is not intended to be exposed to the application. ! /// Instead it is used internally by NHibernate to obtain <see cref="IDbConnection"/>. ! /// Implementors should provide a public default constructor. /// </remarks> ! public interface IConnectionProvider : IDisposable { /// <summary> /// Initialize the connection provider from the given properties. /// </summary> *************** *** 29,55 **** /// <summary> ! /// Grab a connection ! /// </summary> ! /// <returns>An ADO.NET connection</returns> ! IDbConnection GetConnection(); ! ! /// <summary> ! /// Dispose of a used connection /// </summary> ! /// <param name="conn">An ADO.NET connection</param> void CloseConnection( IDbConnection conn ); /// <summary> ! /// Does this ConnectionProvider implement a <c>PreparedStatemnt</c> cache?. /// </summary> ! /// <remarks> ! /// If so, Hibernate will not use its own cache ! /// </remarks> ! bool IsStatementCache { get; } /// <summary> ! /// Release all resources held by this ConnectionProvider. /// </summary> ! void Close(); } --- 23,45 ---- /// <summary> ! /// Dispose of a used <see cref="IDbConnection"/> /// </summary> ! /// <param name="conn">The <see cref="IDbConnection"/> to clean up.</param> void CloseConnection( IDbConnection conn ); /// <summary> ! /// Gets the <see cref="IDriver"/> this ConnectionProvider should use to ! /// communicate with the .NET Data Provider /// </summary> ! /// <value> ! /// The <see cref="IDriver"/> to communicate with the .NET Data Provider. ! /// </value> ! IDriver Driver { get; } /// <summary> ! /// Get an open <see cref="IDbConnection"/>. /// </summary> ! /// <returns>An open <see cref="IDbConnection"/>.</returns> ! IDbConnection GetConnection(); } Index: DriverConnectionProvider.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection/DriverConnectionProvider.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DriverConnectionProvider.cs 31 Dec 2004 16:46:43 -0000 1.4 --- DriverConnectionProvider.cs 30 Jan 2005 19:36:15 -0000 1.5 *************** *** 12,16 **** private static readonly ILog log = LogManager.GetLogger( typeof( DriverConnectionProvider ) ); ! /// <summary></summary> public DriverConnectionProvider() { --- 12,18 ---- private static readonly ILog log = LogManager.GetLogger( typeof( DriverConnectionProvider ) ); ! /// <summary> ! /// Initializes a new instance of the <see cref="DriverConnectionProvider"/> class. ! /// </summary> public DriverConnectionProvider() { *************** *** 18,24 **** /// <summary> ! /// /// </summary> ! /// <returns></returns> public override IDbConnection GetConnection() { --- 20,43 ---- /// <summary> ! /// Closes and Disposes of the <see cref="IDbConnection"/>. /// </summary> ! /// <param name="conn">The <see cref="IDbConnection"/> to clean up.</param> ! public override void CloseConnection( IDbConnection conn ) ! { ! base.CloseConnection( conn ); ! //TODO: make sure I want to do this - pretty sure I do because of Oracle problems. ! conn.Dispose(); ! } ! ! /// <summary> ! /// Gets a new open <see cref="IDbConnection"/> through ! /// the <see cref="NHibernate.Driver.IDriver"/>. ! /// </summary> ! /// <returns> ! /// An Open <see cref="IDbConnection"/>. ! /// </returns> ! /// <exception cref="ADOException"> ! /// If there is any problem creating or opening the <see cref="IDbConnection"/>. ! /// </exception> public override IDbConnection GetConnection() { *************** *** 37,63 **** } - /// <summary></summary> - public override bool IsStatementCache - { - get { return false; } - } - - /// <summary></summary> - public override void Close() - { - log.Info( "cleaning up connection pool" ); - } - - /// <summary> - /// - /// </summary> - /// <param name="conn"></param> - public override void CloseConnection( IDbConnection conn ) - { - base.CloseConnection( conn ); - //TODO: make sure I want to do this - pretty sure I do because of Oracle problems. - conn.Dispose(); - } - } --- 56,59 ---- Index: ConnectionProvider.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection/ConnectionProvider.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ConnectionProvider.cs 31 Dec 2004 16:46:43 -0000 1.9 --- ConnectionProvider.cs 30 Jan 2005 19:36:15 -0000 1.10 *************** *** 11,15 **** /// The base class for the ConnectionProvider. /// </summary> ! public abstract class ConnectionProvider : IConnectionProvider, IDisposable { private static readonly ILog log = LogManager.GetLogger( typeof( ConnectionProvider ) ); --- 11,15 ---- /// The base class for the ConnectionProvider. /// </summary> ! public abstract class ConnectionProvider : IConnectionProvider { private static readonly ILog log = LogManager.GetLogger( typeof( ConnectionProvider ) ); *************** *** 18,24 **** /// <summary> ! /// /// </summary> ! /// <param name="conn"></param> public virtual void CloseConnection( IDbConnection conn ) { --- 18,24 ---- /// <summary> ! /// Closes the <see cref="IDbConnection"/>. /// </summary> ! /// <param name="conn">The <see cref="IDbConnection"/> to clean up.</param> public virtual void CloseConnection( IDbConnection conn ) { *************** *** 37,42 **** /// Configures the ConnectionProvider with the Driver and the ConnectionString. /// </summary> ! /// <param name="settings">A name/value Dictionary that contains the settings for this ConnectionProvider.</param> ! /// <exception cref="HibernateException">Thrown when a ConnectionString could not be found or the Driver Class could not be loaded.</exception> public virtual void Configure( IDictionary settings ) { --- 37,45 ---- /// Configures the ConnectionProvider with the Driver and the ConnectionString. /// </summary> ! /// <param name="settings">An <see cref="IDictionary"/> that contains the settings for this ConnectionProvider.</param> ! /// <exception cref="HibernateException"> ! /// Thrown when a <see cref="Environment.ConnectionString"/> could not be found ! /// in the <c>settings</c> parameter or the Driver Class could not be loaded. ! /// </exception> public virtual void Configure( IDictionary settings ) { *************** *** 56,60 **** /// Configures the driver for the ConnectionProvider. /// </summary> ! /// <param name="settings">A name/value Dictionary that contains the settings for the Driver.</param> protected virtual void ConfigureDriver( IDictionary settings ) { --- 59,68 ---- /// Configures the driver for the ConnectionProvider. /// </summary> ! /// <param name="settings">An <see cref="IDictionary"/> that contains the settings for the Driver.</param> ! /// <exception cref="HibernateException"> ! /// Thrown when the <see cref="Environment.ConnectionDriver"/> could not be ! /// found in the <c>settings</c> parameter or there is a problem with creating ! /// the <see cref="IDriver"/>. ! /// </exception> protected virtual void ConfigureDriver( IDictionary settings ) { *************** *** 79,84 **** /// <summary> ! /// /// </summary> protected virtual string ConnectionString { --- 87,97 ---- /// <summary> ! /// Gets the <see cref="String"/> for the <see cref="IDbConnection"/> ! /// to connect to the database. /// </summary> + /// <value> + /// The <see cref="String"/> for the <see cref="IDbConnection"/> + /// to connect to the database. + /// </value> protected virtual string ConnectionString { *************** *** 87,92 **** /// <summary> ! /// /// </summary> public IDriver Driver { --- 100,108 ---- /// <summary> ! /// Gets the <see cref="IDriver"/> that can create the <see cref="IDbConnection"/> object. /// </summary> + /// <value> + /// The <see cref="IDriver"/> that can create the <see cref="IDbConnection"/>. + /// </value> public IDriver Driver { *************** *** 95,123 **** /// <summary> ! /// Grab a Connection from this ConnectionProvider /// </summary> ! /// <returns></returns> public abstract IDbConnection GetConnection(); /// <summary> ! /// /// </summary> ! public abstract bool IsStatementCache { get; } /// <summary> ! /// /// </summary> ! public abstract void Close(); ! ! #region IDisposable Members /// <summary> ! /// /// </summary> public void Dispose() { ! Close(); } #endregion } --- 111,180 ---- /// <summary> ! /// Get an open <see cref="IDbConnection"/>. /// </summary> ! /// <returns>An open <see cref="IDbConnection"/>.</returns> public abstract IDbConnection GetConnection(); + #region IDisposable Members + /// <summary> ! /// A flag to indicate if <c>Disose()</c> has been called. /// </summary> ! private bool _isAlreadyDisposed; /// <summary> ! /// Finalizer that ensures the object is correctly disposed of. /// </summary> ! ~ConnectionProvider() ! { ! Dispose( false ); ! } /// <summary> ! /// Takes care of freeing the managed and unmanaged resources that ! /// this class is responsible for. /// </summary> public void Dispose() { ! Dispose( true ); } + /// <summary> + /// Takes care of freeing the managed and unmanaged resources that + /// this class is responsible for. + /// </summary> + /// <param name="isDisposing">Indicates if this ConnectionProvider is being Disposed of or Finalized.</param> + /// <remarks> + /// <p> + /// If this ConnectionProvider is being Finalized (<c>isDisposing==false</c>) then make + /// sure not to call any methods that could potentially bring this + /// ConnectionProvider back to life. + /// </p> + /// <p> + /// If any subclasses manage resources that also need to be disposed of this method + /// should be overridden, but don't forget to call it in the override. + /// </p> + /// </remarks> + protected virtual void Dispose(bool isDisposing) + { + if( _isAlreadyDisposed ) + { + // don't dispose of multiple times. + return; + } + + // free managed resources that are being managed by the ConnectionProvider if we + // know this call came through Dispose() + if( isDisposing ) + { + log.Debug( "Disposing of ConnectionProvider." ); + } + + // free unmanaged resources here + + _isAlreadyDisposed = true; + // nothing for Finalizer to do - so tell the GC to ignore it + GC.SuppressFinalize( this ); + } #endregion } Index: UserSuppliedConnectionProvider.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection/UserSuppliedConnectionProvider.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** UserSuppliedConnectionProvider.cs 31 Dec 2004 16:46:43 -0000 1.6 --- UserSuppliedConnectionProvider.cs 30 Jan 2005 19:36:15 -0000 1.7 *************** *** 18,24 **** /// <summary> ! /// /// </summary> ! /// <param name="conn"></param> public override void CloseConnection( IDbConnection conn ) { --- 18,29 ---- /// <summary> ! /// Throws an <see cref="InvalidOperationException"/> if this method is called ! /// because the user is responsible for closing <see cref="IDbConnection"/>s. /// </summary> ! /// <param name="conn">The <see cref="IDbConnection"/> to clean up.</param> ! /// <exception cref="InvalidOperationException"> ! /// Thrown when this method is called. User is responsible for closing ! /// <see cref="IDbConnection"/>s. ! /// </exception> public override void CloseConnection( IDbConnection conn ) { *************** *** 27,33 **** /// <summary> ! /// /// </summary> ! /// <returns></returns> public override IDbConnection GetConnection() { --- 32,45 ---- /// <summary> ! /// Throws an <see cref="InvalidOperationException"/> if this method is called ! /// because the user is responsible for creating <see cref="IDbConnection"/>s. /// </summary> ! /// <returns> ! /// No value is returned because an <see cref="InvalidOperationException"/> is thrown. ! /// </returns> ! /// <exception cref="InvalidOperationException"> ! /// Thrown when this method is called. User is responsible for creating ! /// <see cref="IDbConnection"/>s. ! /// </exception> public override IDbConnection GetConnection() { *************** *** 50,67 **** } - /// <summary></summary> - public override bool IsStatementCache - { - get { return false; } - } - - /// <summary></summary> - public override void Close() - { - // do nothing - don't need to throw an error because this is something - // that NHibernate will call. - } - - } } \ No newline at end of file --- 62,65 ---- |
From: Michael D. <mik...@us...> - 2005-01-30 19:36:25
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32147/NHibernate/Driver Modified Files: NDataReader.cs NHybridDataReader.cs Log Message: Implemented IDisposable according to standard .net pattern Added some more xml comments to Connection namespace. Index: NHybridDataReader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/NHybridDataReader.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NHybridDataReader.cs 31 Dec 2004 17:26:01 -0000 1.2 --- NHybridDataReader.cs 30 Jan 2005 19:36:15 -0000 1.3 *************** *** 29,33 **** /// <summary> ! /// Initializes a new instance of the NHybridDataReader class. /// </summary> /// <param name="reader">The underlying IDataReader to use.</param> --- 29,33 ---- /// <summary> ! /// Initializes a new instance of the <see cref="NHybridDataReader"/> class. /// </summary> /// <param name="reader">The underlying IDataReader to use.</param> *************** *** 132,139 **** #region IDisposable Members ! /// <summary></summary> public void Dispose() { ! _reader.Dispose(); } --- 132,188 ---- #region IDisposable Members ! /// <summary> ! /// A flag to indicate if <c>Disose()</c> has been called. ! /// </summary> ! private bool _isAlreadyDisposed; ! ! /// <summary> ! /// Finalizer that ensures the object is correctly disposed of. ! /// </summary> ! ~NHybridDataReader() ! { ! Dispose( false ); ! } ! ! /// <summary> ! /// Takes care of freeing the managed and unmanaged resources that ! /// this class is responsible for. ! /// </summary> public void Dispose() { ! log.Debug( "running NHybridDataReader.Dispose()" ); ! Dispose( true ); ! } ! ! /// <summary> ! /// Takes care of freeing the managed and unmanaged resources that ! /// this class is responsible for. ! /// </summary> ! /// <param name="isDisposing">Indicates if this NHybridDataReader is being Disposed of or Finalized.</param> ! /// <remarks> ! /// If this NHybridDataReader is being Finalized (<c>isDisposing==false</c>) then make sure not ! /// to call any methods that could potentially bring this NHybridDataReader back to life. ! /// </remarks> ! protected virtual void Dispose(bool isDisposing) ! { ! if( _isAlreadyDisposed ) ! { ! // don't dispose of multiple times. ! return; ! } ! ! // free managed resources that are being managed by the NHybridDataReader if we ! // know this call came through Dispose() ! if( isDisposing ) ! { ! _reader.Dispose(); ! } ! ! // free unmanaged resources here ! ! _isAlreadyDisposed = true; ! // nothing for Finalizer to do - so tell the GC to ignore it ! GC.SuppressFinalize( this ); ! } Index: NDataReader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/NDataReader.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NDataReader.cs 31 Dec 2004 17:25:35 -0000 1.5 --- NDataReader.cs 30 Jan 2005 19:36:15 -0000 1.6 *************** *** 172,176 **** #region IDisposable Members ! /// <summary></summary> public void Dispose() { --- 172,184 ---- #region IDisposable Members ! /// <summary> ! /// Takes care of freeing the managed and unmanaged resources that ! /// this class is responsible for. ! /// </summary> ! /// <remarks> ! /// There are not any unmanaged resources or any disposable managed ! /// resources that this class is holding onto. It is in here ! /// to comply with the <see cref="IDataReader"/> interface. ! /// </remarks> public void Dispose() { |
From: Michael D. <mik...@us...> - 2005-01-30 19:36:24
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32147/NHibernate Modified Files: ITransaction.cs Log Message: Implemented IDisposable according to standard .net pattern Added some more xml comments to Connection namespace. Index: ITransaction.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ITransaction.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ITransaction.cs 24 Jan 2005 03:33:30 -0000 1.4 --- ITransaction.cs 30 Jan 2005 19:36:13 -0000 1.5 *************** *** 1,2 **** --- 1,3 ---- + using System; using System.Data; *************** *** 15,20 **** /// at a time. Implementors are not intended to be threadsafe. /// </remarks> ! //TODO: add IDisposable ! public interface ITransaction { /// <summary> --- 16,20 ---- /// at a time. Implementors are not intended to be threadsafe. /// </remarks> ! public interface ITransaction : IDisposable { /// <summary> *************** *** 33,37 **** /// <summary> ! /// Was the transaction folled back or set to rollback only? /// </summary> bool WasRolledBack { get; } --- 33,37 ---- /// <summary> ! /// Was the transaction rolled back or set to rollback only? /// </summary> bool WasRolledBack { get; } |
From: John M. <joh...@us...> - 2005-01-30 15:04:48
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3131/src/NHibernate.Tool.Net2Hbm Modified Files: NHibernate.Tool.Net2Hbm-1.1.csproj Log Message: Added the start of a readme document. Index: NHibernate.Tool.Net2Hbm-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm/NHibernate.Tool.Net2Hbm-1.1.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NHibernate.Tool.Net2Hbm-1.1.csproj 30 Dec 2004 16:54:02 -0000 1.1 --- NHibernate.Tool.Net2Hbm-1.1.csproj 30 Jan 2005 15:04:37 -0000 1.2 *************** *** 174,177 **** --- 174,181 ---- /> <File + RelPath = "readme.txt" + BuildAction = "Content" + /> + <File RelPath = "SetAttribute.cs" SubType = "Code" |
From: John M. <joh...@us...> - 2005-01-30 14:56:59
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1420/src/NHibernate.Tool.Net2Hbm Added Files: readme.txt Log Message: Added the start of a readme document. --- NEW FILE: readme.txt --- Net2Hbm Tool ---------------------------------------------------- The Net2Hbm tool can be used to generate NHibernate mapping documents. The tool uses .NET attributes to allow the programmer to decorate their code with attributes. These attributes are interpreted by the MapGenerator class. The resulting map stream can be used to configure the NHibernate configuration object. |
From: Michael D. <mik...@us...> - 2005-01-30 14:03:14
|
Update of /cvsroot/nhibernate/CVSROOT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23329 Modified Files: avail Log Message: Added johntmorris to the Contrib commit rights. Index: avail =================================================================== RCS file: /cvsroot/nhibernate/CVSROOT/avail,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** avail 28 Dec 2004 16:47:56 -0000 1.2 --- avail 30 Jan 2005 14:03:05 -0000 1.3 *************** *** 1,4 **** unavail ! avail|luggage, kevinwilliams|NHibernateContrib avail|kevinwilliams|nhibernate avail|mikedoerfler, szoke --- 1,4 ---- unavail ! avail|luggage, kevinwilliams, johntmorris|NHibernateContrib avail|kevinwilliams|nhibernate avail|mikedoerfler, szoke |
From: Michael D. <mik...@us...> - 2005-01-28 13:34:35
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11072 Modified Files: IQuery.cs Log Message: updated xml comments to explain limits and remove some java specific example code. Index: IQuery.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/IQuery.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** IQuery.cs 1 Jan 2005 03:33:40 -0000 1.13 --- IQuery.cs 28 Jan 2005 13:33:56 -0000 1.14 *************** *** 13,18 **** /// <c>ISession.Find()</c>; /// <list> ! /// <item>A particulare page of the result set may be selected by calling ! /// <c>SetMaxResults()</c>, <c>SetFirstResult</c></item> /// <item>Named query parameters may be used</item> /// </list> --- 13,25 ---- /// <c>ISession.Find()</c>; /// <list> ! /// <item> ! /// A particulare page of the result set may be selected by calling ! /// <c>SetMaxResults()</c>, <c>SetFirstResult()</c>. The generated sql ! /// depends on the capabilities of the <see cref="Dialect.Dialect"/>. Some ! /// Dialects are for databases that have built in paging (LIMIT) and those capabilities ! /// will be used to limit the number of records returned by the sql statement. ! /// If the database does not support LIMITs then all of the records will be returned, ! /// but the objects created will be limited to the specific results requested. ! /// </item> /// <item>Named query parameters may be used</item> /// </list> *************** *** 21,35 **** /// to the <c>Int32</c> parameter <c>:foo</c> by calling /// <code> ! /// SetParameter("foo", foo, NHibernate.Int32); /// </code> /// for example. A name may appear multiple times in the query string. /// </para> /// <para> ! /// JDBC-stype <c>?</c> parameters are also supported. To bind a value to a JDBC-style ! /// parameter use a set method that accepts an <c>int</c> positional argument - numbered from /// zero. /// </para> /// <para> ! /// You may not mix and match JDBC-style parameters and named parameters in the same query. /// </para> /// <para> --- 28,42 ---- /// to the <c>Int32</c> parameter <c>:foo</c> by calling /// <code> ! /// SetParameter("foo", foo, NHibernateUtil.Int32); /// </code> /// for example. A name may appear multiple times in the query string. /// </para> /// <para> ! /// Unnamed parameters <c>?</c> are also supported. To bind a value to an unnamed ! /// parameter use a Set method that accepts an <c>Int32</c> positional argument - numbered from /// zero. /// </para> /// <para> ! /// You may not mix and match unnamed parameters and named parameters in the same query. /// </para> /// <para> |
From: Donald L M. Jr. <lu...@us...> - 2005-01-26 21:34:15
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24286/src/Nullables.NHibernate Modified Files: NullableBooleanType.cs NullableByteType.cs NullableDateTimeType.cs NullableDecimalType.cs NullableDoubleType.cs NullableGuidType.cs NullableInt16Type.cs NullableInt32Type.cs NullableInt64Type.cs NullableSingleType.cs Log Message: Changed Get() to use Convert.To__() instead of a cast to handle certain (broken?) ADO.NET providers that return unexpexted types. NullableGuidType.Get() will also accept a string (for DB's that have no Guid type, like MySQL). Index: NullableInt64Type.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableInt64Type.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableInt64Type.cs 26 Jan 2005 21:23:53 -0000 1.2 --- NullableInt64Type.cs 26 Jan 2005 21:34:03 -0000 1.3 *************** *** 62,66 **** else { ! return new NullableInt64((Int64)value); } } --- 62,66 ---- else { ! return new NullableInt64(Convert.ToInt64(value)); } } Index: NullableByteType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableByteType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableByteType.cs 26 Jan 2005 21:23:53 -0000 1.2 --- NullableByteType.cs 26 Jan 2005 21:34:03 -0000 1.3 *************** *** 61,65 **** else { ! return new NullableByte((Byte)value); } } --- 61,65 ---- else { ! return new NullableByte(Convert.ToByte(value)); } } Index: NullableSingleType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableSingleType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableSingleType.cs 26 Jan 2005 21:23:53 -0000 1.2 --- NullableSingleType.cs 26 Jan 2005 21:34:03 -0000 1.3 *************** *** 67,71 **** else { ! return new NullableSingle((Single)value); } } --- 67,71 ---- else { ! return new NullableSingle(Convert.ToSingle(value)); } } *************** *** 91,93 **** } } ! } --- 91,93 ---- } } ! } \ No newline at end of file Index: NullableDoubleType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableDoubleType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableDoubleType.cs 26 Jan 2005 21:23:53 -0000 1.2 --- NullableDoubleType.cs 26 Jan 2005 21:34:03 -0000 1.3 *************** *** 62,66 **** else { ! return new NullableDouble((Double)value); } } --- 62,66 ---- else { ! return new NullableDouble(Convert.ToDouble(value)); } } Index: NullableInt32Type.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableInt32Type.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableInt32Type.cs 26 Jan 2005 21:23:53 -0000 1.2 --- NullableInt32Type.cs 26 Jan 2005 21:34:03 -0000 1.3 *************** *** 62,66 **** else { ! return new NullableInt32((Int32)value); } } --- 62,66 ---- else { ! return new NullableInt32(Convert.ToInt32(value)); } } Index: NullableDecimalType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableDecimalType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableDecimalType.cs 26 Jan 2005 21:23:53 -0000 1.2 --- NullableDecimalType.cs 26 Jan 2005 21:34:03 -0000 1.3 *************** *** 63,67 **** else { ! return new NullableDecimal((Decimal)value); } } --- 63,67 ---- else { ! return new NullableDecimal(Convert.ToDecimal(value)); } } Index: NullableDateTimeType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableDateTimeType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableDateTimeType.cs 26 Jan 2005 21:23:53 -0000 1.2 --- NullableDateTimeType.cs 26 Jan 2005 21:34:03 -0000 1.3 *************** *** 62,66 **** else { ! return new NullableDateTime((DateTime)value); } } --- 62,66 ---- else { ! return new NullableDateTime(Convert.ToDateTime(value)); } } Index: NullableBooleanType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableBooleanType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableBooleanType.cs 26 Jan 2005 21:23:53 -0000 1.2 --- NullableBooleanType.cs 26 Jan 2005 21:34:03 -0000 1.3 *************** *** 62,66 **** else { ! return new NullableBoolean((Boolean)value); } } --- 62,66 ---- else { ! return new NullableBoolean(Convert.ToBoolean(value)); } } Index: NullableInt16Type.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableInt16Type.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableInt16Type.cs 26 Jan 2005 21:23:53 -0000 1.2 --- NullableInt16Type.cs 26 Jan 2005 21:34:03 -0000 1.3 *************** *** 62,66 **** else { ! return new NullableInt16((Int16)value); } } --- 62,66 ---- else { ! return new NullableInt16(Convert.ToInt16(value)); } } Index: NullableGuidType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableGuidType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableGuidType.cs 26 Jan 2005 21:23:53 -0000 1.2 --- NullableGuidType.cs 26 Jan 2005 21:34:03 -0000 1.3 *************** *** 60,67 **** return NullableGuid.Default; } ! else { return new NullableGuid((Guid)value); } } --- 60,71 ---- return NullableGuid.Default; } ! else if (value is Guid) { return new NullableGuid((Guid)value); } + else + { + return new NullableGuid(new Guid(value.ToString())); //certain DB's that have no Guid (MySQL) will return strings. + } } |
From: Donald L M. Jr. <lu...@us...> - 2005-01-26 21:24:06
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21498/src/Nullables.NHibernate Modified Files: NullableBooleanType.cs NullableByteType.cs NullableDateTimeType.cs NullableDecimalType.cs NullableDoubleType.cs NullableGuidType.cs NullableInt16Type.cs NullableInt32Type.cs NullableInt64Type.cs NullableSingleType.cs NullableTypesType.cs Log Message: Removed the override for Get(IDataReader, string) from the individual types and implemented it in NullablesTypesType. Index: NullableInt64Type.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableInt64Type.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableInt64Type.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableInt64Type.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 66,84 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableInt64 has a method/operator/contructor that will take an object. - object value = rs[name]; - - if( value==DBNull.Value ) - { - return NullableInt64.Default; - } - else - { - return new NullableInt64((Int64)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 66,69 ---- Index: NullableByteType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableByteType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableByteType.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableByteType.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 65,83 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableByte has a method/operator/contructor that will take an object. - object value = rs[name]; - - if( value==DBNull.Value ) - { - return NullableByte.Default; - } - else - { - return new NullableByte((Byte)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 65,68 ---- Index: NullableTypesType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableTypesType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableTypesType.cs 6 Dec 2004 03:16:59 -0000 1.2 --- NullableTypesType.cs 26 Jan 2005 21:23:53 -0000 1.3 *************** *** 56,59 **** --- 56,64 ---- } + public override object Get(System.Data.IDataReader rs, string name) + { + return Get(rs, rs.GetOrdinal(name)); + } + public abstract object NullValue{ get; } } Index: NullableDoubleType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableDoubleType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableDoubleType.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableDoubleType.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 66,84 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableDouble has a method/operator/contructor that will take an object. - object value = rs[name]; - - if( value==DBNull.Value ) - { - return NullableDouble.Default; - } - else - { - return new NullableDouble((Double)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 66,69 ---- Index: NullableInt32Type.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableInt32Type.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableInt32Type.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableInt32Type.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 66,84 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableInt32 has a method/operator/contructor that will take an object. - object value = rs[name]; - - if( value==DBNull.Value ) - { - return NullableInt32.Default; - } - else - { - return new NullableInt32((Int32)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 66,69 ---- Index: NullableDecimalType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableDecimalType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableDecimalType.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableDecimalType.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 67,85 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableDecimal has a method/operator/contructor that will take an object. - object value = rs[name]; - - if( value==DBNull.Value ) - { - return NullableDecimal.Default; - } - else - { - return new NullableDecimal((Decimal)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 67,70 ---- Index: NullableInt16Type.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableInt16Type.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableInt16Type.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableInt16Type.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 66,84 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableInt16 has a method/operator/contructor that will take an object. - object value = rs[name]; - - if( value==DBNull.Value ) - { - return NullableInt16.Default; - } - else - { - return new NullableInt16((Int16)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 66,69 ---- Index: NullableDateTimeType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableDateTimeType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableDateTimeType.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableDateTimeType.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 66,84 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableDateTime has a method/operator/contructor that will take an object. - object value = rs[name]; - - if( value==DBNull.Value ) - { - return NullableDateTime.Default; - } - else - { - return new NullableDateTime((DateTime)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 66,69 ---- Index: NullableSingleType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableSingleType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableSingleType.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableSingleType.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 71,89 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableSingle has a method/operator/contructor that will take an object. - object value = rs[name]; - - if( value==DBNull.Value ) - { - return NullableSingle.Default; - } - else - { - return new NullableSingle((Single)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 71,74 ---- Index: NullableBooleanType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableBooleanType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableBooleanType.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableBooleanType.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 66,83 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableBoolean has a method/operator/contructor that will take an object. - object value = rs[name]; - if( value==DBNull.Value ) - { - return NullableBoolean.Default; - } - else - { - return new NullableBoolean((Boolean)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 66,69 ---- Index: NullableGuidType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableGuidType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableGuidType.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableGuidType.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 66,84 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableGuid has a method/operator/contructor that will take an object. - object value = rs[name]; - - if( value==DBNull.Value ) - { - return NullableGuid.Default; - } - else - { - return new NullableGuid((Guid)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 66,69 ---- |
From: Michael D. <mik...@us...> - 2005-01-25 13:37:18
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15639/Driver Added Files: OracleDataClientDriver.cs Log Message: Added OracleClientDriver --- NEW FILE: OracleDataClientDriver.cs --- using System; namespace NHibernate.Driver { /// <summary> /// A NHibernate Driver for using the Oracle.DataAccess DataProvider /// </summary> /// <remarks> /// Code was contributed by <a href="http://sourceforge.net/users/jemcalgary/">James Mills</a> /// on the NHibernate forums in this /// <a href="http://sourceforge.net/forum/message.php?msg_id=2952662">post</a>. /// </remarks> public class OracleDataClientDriver : DriverBase { private System.Type connectionType; private System.Type commandType; /// <summary> /// Initializes a new instance of <see cref="OracleDataClientDriver"/>. /// </summary> public OracleDataClientDriver() { connectionType = System.Type.GetType( "Oracle.DataAccess.Client.OracleConnection, Oracle.DataAccess" ); commandType =System. Type.GetType( "Oracle.DataAccess.Client.OracleCommand, Oracle.DataAccess" ); if( connectionType == null || commandType == null ) { throw new HibernateException( "The IDbCommand and IDbConnection implementation in the Assembly Oracle.DataAccess could not be found. " + "Please ensure that the Assemblies Oracle.DataAccess.dll " + "are in the Global Assembly Cache or in a location that NHibernate " + "can use System.Type.GetType(string) to load the types from." ); } } /// <summary></summary> public override System.Type CommandType { get { return commandType; } } /// <summary></summary> public override System.Type ConnectionType { get { return connectionType; } } /// <summary></summary> public override bool UseNamedPrefixInSql { get { return true; } } /// <summary></summary> public override bool UseNamedPrefixInParameter { get { return true; } } /// <summary></summary> public override string NamedPrefix { get { return ":"; } } } } |
From: Michael D. <mik...@us...> - 2005-01-25 13:37:17
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15639 Modified Files: NHibernate-1.1.csproj Log Message: Added OracleClientDriver Index: NHibernate-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate-1.1.csproj,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** NHibernate-1.1.csproj 23 Jan 2005 15:41:02 -0000 1.69 --- NHibernate-1.1.csproj 25 Jan 2005 13:37:08 -0000 1.70 *************** *** 595,598 **** --- 595,603 ---- /> <File + RelPath = "Driver\OracleDataClientDriver.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Driver\SqlClientDriver.cs" SubType = "Code" |
From: Michael D. <mik...@us...> - 2005-01-24 03:47:50
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11554/NHibernate Modified Files: LazyInitializationException.cs Log Message: NH-189: Fixed LazyInitializationException so it doesn't lose the original exception. Index: LazyInitializationException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/LazyInitializationException.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LazyInitializationException.cs 1 Jan 2005 03:34:01 -0000 1.6 --- LazyInitializationException.cs 24 Jan 2005 03:47:41 -0000 1.7 *************** *** 10,14 **** /// </summary> [Serializable] ! public class LazyInitializationException : Exception { /// <summary> --- 10,14 ---- /// </summary> [Serializable] ! public class LazyInitializationException : HibernateException { /// <summary> *************** *** 16,20 **** /// </summary> /// <param name="root"></param> ! public LazyInitializationException( Exception root ) : this( root.Message ) { } --- 16,20 ---- /// </summary> /// <param name="root"></param> ! public LazyInitializationException( Exception root ) : base( "NHibernate lazy initialization problem", root ) { } *************** *** 34,38 **** /// <param name="message"></param> /// <param name="root"></param> ! public LazyInitializationException( string message, Exception root ) : this( message + " " + root.Message ) { } --- 34,38 ---- /// <param name="message"></param> /// <param name="root"></param> ! public LazyInitializationException( string message, Exception root ) : base( message, root ) { } |
From: Michael D. <mik...@us...> - 2005-01-24 03:45:10
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10598/NHibernate.Test Modified Files: FooBarTest.cs Log Message: updated a test to use ISession.Dispose() instead of ISession.Close() Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** FooBarTest.cs 17 Jan 2005 03:40:51 -0000 1.81 --- FooBarTest.cs 24 Jan 2005 03:44:48 -0000 1.82 *************** *** 2149,2153 **** g.Name = "glarch"; s.Flush(); ! s.Close(); // grab a version of g that is old and hold onto it until later --- 2149,2154 ---- g.Name = "glarch"; s.Flush(); ! //s.Close(); ! s.Dispose(); // grab a version of g that is old and hold onto it until later *************** *** 2158,2162 **** NHibernateUtil.Initialize( gOld ); Assert.IsTrue( NHibernateUtil.IsInitialized( gOld ), "should be initialized" ); ! sOld.Close(); s = sessions.OpenSession(); --- 2159,2164 ---- NHibernateUtil.Initialize( gOld ); Assert.IsTrue( NHibernateUtil.IsInitialized( gOld ), "should be initialized" ); ! //sOld.Close(); ! sOld.Dispose(); s = sessions.OpenSession(); *************** *** 2171,2175 **** g.Name = "bar"; s.Flush(); ! s.Close(); // now that g has been changed verify that we can't go back and update --- 2173,2178 ---- g.Name = "bar"; s.Flush(); ! //s.Close(); ! s.Dispose(); // now that g has been changed verify that we can't go back and update *************** *** 2182,2191 **** sOld.Update( gOld, gid ); sOld.Flush(); ! sOld.Close(); } catch(Exception e) { Exception exc = e; ! while( e!=null ) { if( exc is StaleObjectStateException ) --- 2185,2195 ---- sOld.Update( gOld, gid ); sOld.Flush(); ! //sOld.Close(); ! sOld.Dispose(); } catch(Exception e) { Exception exc = e; ! while( exc!=null ) { if( exc is StaleObjectStateException ) *************** *** 2213,2217 **** s.Delete(g); s.Flush(); ! s.Close(); } --- 2217,2222 ---- s.Delete(g); s.Flush(); ! //s.Close(); ! s.Dispose(); } |
From: Michael D. <mik...@us...> - 2005-01-24 03:41:56
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9662/NHibernate/Impl Modified Files: SessionImpl.cs Log Message: implemented IDisposable according to .net standards - finalizer, Dispose, and Dispose(bool). Still need to modify some other classes for IDisposable and to throw ObjectDisposedException on certain operations. Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** SessionImpl.cs 17 Jan 2005 03:40:57 -0000 1.60 --- SessionImpl.cs 24 Jan 2005 03:41:47 -0000 1.61 *************** *** 37,47 **** private long timestamp; ! private bool closed = false; private FlushMode flushMode = FlushMode.Auto; private bool callAfterTransactionCompletionFromDisconnect = true; ! private IDictionary entitiesByKey; //key=Key, value=Object ! private IDictionary proxiesByKey; //key=Key, value=HibernateProxy // these are used to serialize the proxiesByKey Dictionary - I was not able to --- 37,75 ---- private long timestamp; ! /// <summary> ! /// Indicates if the Session has been closed. ! /// </summary> ! /// <value> ! /// <c>false</c> (by default) if the Session is Open and can be used, ! /// <c>true</c> if the Session has had the methods <c>Close()</c> or ! /// <c>Dispose()</c> invoked.</value> ! private bool closed; private FlushMode flushMode = FlushMode.Auto; + /// <summary> + /// A boolean indicating if the method AfterTransactionCompletion() should + /// be called from the method Disconnect(). + /// </summary> + /// <value> + /// <c>true</c> (by default) if the method should be called. + /// </value> + /// <remarks> + /// This is set to false when the method BeginTransaction() is invoked + /// because the Transaction will call the method AfterTransactionCompletion() + /// when the Transaction is Committed. + /// </remarks> private bool callAfterTransactionCompletionFromDisconnect = true; ! /// <summary> ! /// An <see cref="IDictionary"/> with the <see cref="Key"/> as the key ! /// and an <see cref="Object"/> as the value. ! /// </summary> ! private IDictionary entitiesByKey; ! ! /// <summary> ! /// An <see cref="IDictionary"/> with the <see cref="Key"/> as the key ! /// and an <see cref="INHibernateProxy"/> as the value. ! /// </summary> ! private IDictionary proxiesByKey; // these are used to serialize the proxiesByKey Dictionary - I was not able to *************** *** 55,63 **** //IdentityMaps are serializable in NH ! private IdentityMap entries; //key=Object, value=EntityEntry ! private IdentityMap arrayHolders; //key=array, value=ArrayHolder ! private IdentityMap collections; //key=PersistentCollection, value=CollectionEntry ! private ISet nullifiables = new HashedSet(); //set of Keys of deleted objects private IInterceptor interceptor; --- 83,106 ---- //IdentityMaps are serializable in NH ! /// <summary> ! /// An <see cref="IdentityMap"/> with the <see cref="Object"/> as the key ! /// and an <see cref="EntityEntry"/> as the value. ! /// </summary> ! private IdentityMap entries; ! /// <summary> ! /// An <see cref="IdentityMap"/> with the <see cref="Array"/> as the key ! /// and an <see cref="ArrayHolder"/> as the value. ! /// </summary> ! private IdentityMap arrayHolders; ! /// <summary> ! /// An <see cref="IdentityMap"/> with the <see cref="PersistentCollection"/> as the key ! /// and an <see cref="CollectionEntry"/> as the value. ! /// </summary> ! private IdentityMap collections; ! /// <summary> ! /// An <see cref="ISet"/> of <see cref="Key"/> objects of the deleted entities. ! /// </summary> ! private ISet nullifiables = new HashedSet(); private IInterceptor interceptor; *************** *** 66,74 **** private IDbConnection connection; [NonSerialized] private bool connect; - // TODO: find out if we want the reference to IDbTransaction or ITransaction - leaning - // towards an ITransaction because we can get the IDbTransaction from that. [NonSerialized] private ITransaction transaction; --- 109,136 ---- private IDbConnection connection; + /// <summary> + /// A boolean indicating if the Session should automattically connect to the + /// database - ie, open a new <see cref="IDbConnection"/> for the operation if + /// <c>this.Connection==null</c>. + /// </summary> + /// <remarks> + /// <p> + /// This will be initialzed to <c>true</c> by the ctor if NHibernate is managing + /// the Connections, <c>false</c> if the user passes in their own connection - + /// indicating they will be responsible for managing connections. + /// </p> + /// <p> + /// This can also be set to <c>false</c> when NHibernate has opened the connection + /// on its own and the Session has had the methods <c>Close()</c> or + /// <c>Disconnect()</c> invoked. + /// </p> + /// <p> + /// This can also be set to <c>true</c> when the Session has had the method + /// <c>Reconnect()</c> invoked. + /// </p> + /// </remarks> [NonSerialized] private bool connect; [NonSerialized] private ITransaction transaction; *************** *** 355,359 **** try { ! return ( connection == null ) ? null : Disconnect(); } finally --- 417,431 ---- try { ! // when the connection is null nothing needs to be done - if there ! // is a value for connection then Disconnect() was not called - so we ! // need to ensure it gets called. ! if( connection==null ) ! { ! return null; ! } ! else ! { ! return Disconnect(); ! } } finally *************** *** 363,367 **** } ! /// <summary></summary> public void AfterTransactionCompletion() { --- 435,443 ---- } ! /// <summary> ! /// Ensure that the locks are downgraded to <see cref="LockMode.None"/> ! /// and that all of the softlocks in the <see cref="Cache"/> have ! /// been released. ! /// </summary> public void AfterTransactionCompletion() { *************** *** 393,397 **** executions.Clear(); ! callAfterTransactionCompletionFromDisconnect = true; //not really necessary } --- 469,475 ---- executions.Clear(); ! // the transaction was completed so reset the field callAfter... to its default ! // value. ! callAfterTransactionCompletionFromDisconnect = true; //h2.0.3-not really necessary } *************** *** 407,410 **** --- 485,493 ---- } + /// <summary> + /// Mark the Session as being closed and Clear out the HashTables of + /// entities and proxies along with the Identity Maps for entries, array + /// holders, collections, and nullifiables. + /// </summary> private void Cleanup() { *************** *** 3848,3852 **** } ! /// <summary></summary> public bool IsConnected { --- 3931,3945 ---- } ! /// <summary> ! /// Gets if the ISession is connected. ! /// </summary> ! /// <value> ! /// <c>true</c> if the ISession is connected. ! /// </value> ! /// <remarks> ! /// An ISession is considered connected if there is an <see cref="IDbConnection"/> (regardless ! /// of its state) or if it the field <c>connect</c> is true. Meaning that it will connect ! /// at the next operation that requires a connection. ! /// </remarks> public bool IsConnected { *************** *** 3861,3866 **** --- 3954,3962 ---- try { + // the Session is flagged as needing to create a Connection for the + // next operation if( connect ) { + // a Disconnected Session should not automattically "connect" connect = false; return null; *************** *** 3868,3872 **** else { ! if( connection == null ) { throw new HibernateException( "session already disconnected" ); --- 3964,3968 ---- else { ! if( connection==null ) { throw new HibernateException( "session already disconnected" ); *************** *** 3877,3884 **** --- 3973,3989 ---- batcher.CloseCommands(); } + + // get a new reference to the the Session's connection before + // closing it - and set the existing to Session's connection to + // null but don't close it yet IDbConnection c = connection; connection = null; + + // if Session is supposed to auto-close the connection then + // the Sesssion is managing the IDbConnection. if( autoClose ) { + // let the SessionFactory close it and return null + // because the connection is internal to the Session factory.CloseConnection( c ); return null; *************** *** 3886,3889 **** --- 3991,3996 ---- else { + // return the connection the user provided - at this point + // it has been disassociated with the NHibernate session. return c; } *************** *** 3892,3895 **** --- 3999,4004 ---- finally { + // ensure that AfterTransactionCompletion gets called since + // it takes care of the Locks and Cache. if( callAfterTransactionCompletionFromDisconnect ) { *************** *** 3928,3955 **** /// <summary> /// Just in case the user forgot to Commit() or Close() /// </summary> ! void IDisposable.Dispose() { log.Debug( "running ISession.Dispose()" ); ! // 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(); } } } } --- 4037,4134 ---- /// <summary> + /// A flag to indicate if <c>Disose()</c> has been called. + /// </summary> + private bool _isAlreadyDisposed; + + /// <summary> + /// Finalizer that ensures the object is correctly disposed of. + /// </summary> + ~SessionImpl() + { + Dispose( false ); + } + + /// <summary> /// Just in case the user forgot to Commit() or Close() /// </summary> ! public void Dispose() { 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(); ! // } ! // } ! // } ! } ! ! /// <summary> ! /// Takes care of freeing the managed and unmanaged resources that ! /// this class is responsible for. ! /// </summary> ! /// <param name="isDisposing">Indicates if this Session is being Disposed of or Finalized.</param> ! /// <remarks> ! /// If this Session is being Finalized (<c>isDisposing==false</c>) then make sure not ! /// to call any methods that could potentially bring this Session back to life. ! /// </remarks> ! protected virtual void Dispose(bool isDisposing) ! { ! if( _isAlreadyDisposed ) { ! // don't dispose of multiple times. ! return; ! } ! // free managed resources that are being managed by the session if we ! // know this call came through Dispose() ! if( isDisposing ) ! { ! // we are not reusing the Close() method because that sets the connection==null ! // during the Close() - if the connection is null we can't get to it to Dispose ! // of it. ! if( connection!=null ) { ! // ensure the Locks are downgraded and the Cache releases its softlocks. ! AfterTransactionCompletion(); } ! //TODO: add a Dispose to IBatcher (NDataReader), & ITransaction ! ! // if the Session is responsible for managing the connection then make sure ! // the connection is disposed of. ! if( autoClose ) { ! if( connection!=null ) { ! connection.Dispose(); } } + + // 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 + // to be reassociated with another Session. If the Proxy sees ISession.IsOpen==true + // then an exception will be thrown for trying to associate it with 2 open sessions. + Cleanup(); + } + + // free unmanaged resources here + + _isAlreadyDisposed = true; + // nothing for Finalizer to do - so tell the GC to ignore it + GC.SuppressFinalize( this ); } |
From: Michael D. <mik...@us...> - 2005-01-24 03:33:45
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7654/NHibernate Modified Files: ITransaction.cs Log Message: added a TODO to implement IDisposable. Index: ITransaction.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ITransaction.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ITransaction.cs 1 Jan 2005 03:34:01 -0000 1.3 --- ITransaction.cs 24 Jan 2005 03:33:30 -0000 1.4 *************** *** 15,18 **** --- 15,19 ---- /// at a time. Implementors are not intended to be threadsafe. /// </remarks> + //TODO: add IDisposable public interface ITransaction { |
From: Michael D. <mik...@us...> - 2005-01-24 03:33:44
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7654/NHibernate/Engine Modified Files: IBatcher.cs Log Message: added a TODO to implement IDisposable. Index: IBatcher.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/IBatcher.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** IBatcher.cs 31 Dec 2004 17:36:22 -0000 1.5 --- IBatcher.cs 24 Jan 2005 03:33:30 -0000 1.6 *************** *** 20,23 **** --- 20,24 ---- /// </para> /// </remarks> + //TODO: add IDisposable public interface IBatcher { |
From: Michael D. <mik...@us...> - 2005-01-24 03:31:54
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7247/NHibernate/Impl Modified Files: SessionFactoryImpl.cs Log Message: some comments added to the code. Index: SessionFactoryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** SessionFactoryImpl.cs 31 Dec 2004 19:54:19 -0000 1.38 --- SessionFactoryImpl.cs 24 Jan 2005 03:31:45 -0000 1.39 *************** *** 421,425 **** public ISession OpenSession( IDbConnection connection, IInterceptor interceptor ) { ! //TODO: figure out why autoClose was set to false - diff in JDBC vs ADO.NET??? return OpenSession( connection, false, long.MinValue, interceptor ); } --- 421,426 ---- public ISession OpenSession( IDbConnection connection, IInterceptor interceptor ) { ! // specify false for autoClose because the user has passed in an IDbConnection ! // and they assume responsibility for it. return OpenSession( connection, false, long.MinValue, interceptor ); } *************** *** 433,436 **** --- 434,439 ---- { long timestamp = Timestamper.Next(); + // specify true for autoClose because NHibernate has responsibility for + // the IDbConnection. return OpenSession( null, true, timestamp, interceptor ); } |
From: Michael D. <mik...@us...> - 2005-01-23 16:26:18
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26460/NHibernate Modified Files: NHibernate.build Log Message: NHibernate is now marked as ComVisible=false Index: NHibernate.build =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate.build,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** NHibernate.build 16 Dec 2004 21:52:56 -0000 1.8 --- NHibernate.build 23 Jan 2005 16:26:10 -0000 1.9 *************** *** 47,53 **** --- 47,55 ---- <import name="System.Reflection" /> <import name="System.Runtime.CompilerServices" /> + <import name="System.Runtime.InteropServices" /> </imports> <attributes> <attribute type="CLSCompliantAttribute" value="true" /> + <attribute type="ComVisibleAttribute" value="false" /> <attribute type="AssemblyTitleAttribute" value="${nant.project.name} for ${current.runtime.description}" /> <attribute type="AssemblyDescriptionAttribute" value="An object persistence library for relational databases." /> |
From: Michael D. <mik...@us...> - 2005-01-23 15:54:32
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19296/Engine Modified Files: Cascades.cs Log Message: removed section of code that was commented out Index: Cascades.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/Cascades.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Cascades.cs 31 Dec 2004 17:36:22 -0000 1.11 --- Cascades.cs 23 Jan 2005 15:54:23 -0000 1.12 *************** *** 314,323 **** } - // [System.Obsolete( "This is being replaced by the Cascade with a deleteOrphans as the last param." )] - // private static void Cascade( ISessionImplementor session, object child, IType type, CascadingAction action, CascadePoint cascadeTo ) - // { - // Cascade( session, child, type, action, cascadeTo, false ); - // } - /// <summary> /// Cascade an action to the Child. --- 314,317 ---- |
From: Michael D. <mik...@us...> - 2005-01-23 15:54:01
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19159/Impl Modified Files: BatcherImpl.cs Log Message: changed excpetion caught to the one msdn documents Prepare will throw. Changed exception thrown to ADOException instead of ApplicationException. Index: BatcherImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/BatcherImpl.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** BatcherImpl.cs 31 Dec 2004 19:50:33 -0000 1.14 --- BatcherImpl.cs 23 Jan 2005 15:53:52 -0000 1.15 *************** *** 131,139 **** } } ! catch( Exception e ) { ! throw new ApplicationException( "While preparing " + command.CommandText + " an error occurred" ! , e ); } } --- 131,139 ---- } } ! catch( InvalidOperationException ioe ) { ! throw new ADOException( "While preparing " + command.CommandText + " an error occurred" ! , ioe ); } } |