From: Michael D. <mik...@us...> - 2004-09-14 17:50:04
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11256/Engine Modified Files: IBatcher.cs ISessionImplementor.cs Removed Files: IPreparer.cs Log Message: Major refactoring with NDataReader and Batcher. NHibernate now uses an IDataReader returned from the Driver for as long as possible before converting to a NDataReader. This has nice perf gains on the simple performance test in the Test Fixtures. --- IPreparer.cs DELETED --- Index: ISessionImplementor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/ISessionImplementor.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ISessionImplementor.cs 14 Jul 2004 21:22:16 -0000 1.20 --- ISessionImplementor.cs 14 Sep 2004 17:49:54 -0000 1.21 *************** *** 159,169 **** /// <summary> - /// Get the NHibernate Command Preparer for this Session. - /// new to NH - /// </summary> - IPreparer Preparer {get; } - //TODO: this will eventually replace the Batcher... - - /// <summary> /// After actually inserting a row, record the fact taht the instance exists on the database /// (needed for identity-column key generation) --- 159,162 ---- Index: IBatcher.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/IBatcher.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IBatcher.cs 28 Aug 2004 04:18:40 -0000 1.3 --- IBatcher.cs 14 Sep 2004 17:49:54 -0000 1.4 *************** *** 7,11 **** { /// <summary> ! /// Manages <c>IDbCommand</c>s for a session. /// </summary> /// <remarks> --- 7,11 ---- { /// <summary> ! /// Manages <see cref="IDbCommand">IDbCommands</see> and <see cref="IDataReader">IDataReaders</see> for a session. /// </summary> /// <remarks> *************** *** 37,50 **** IDbCommand PrepareQueryCommand(SqlString sql, bool scrollable); - // TODO: how applicable is this???? /// <summary> ! /// Closes a command opened with <c>PrepareQueryStatement</c> /// </summary> ! /// <param name="cmd"></param> ! /// <param name="reader"></param> ! /// <remarks> ! /// TODO: Not sure this is needed - with jdbc you can close a statement - does this ! /// have an equivalent of Disposing and IDbCommand??? ! /// </remarks> void CloseQueryCommand(IDbCommand cmd, IDataReader reader); --- 37,46 ---- IDbCommand PrepareQueryCommand(SqlString sql, bool scrollable); /// <summary> ! /// Closes the <see cref="IDbCommand"/> & the <see cref="IDataReader"/> that was ! /// opened with <c>PrepareQueryCommand</c>. /// </summary> ! /// <param name="cmd">The <see cref="IDbCommand"/> to close.</param> ! /// <param name="reader">The <see cref="IDataReader"/> to close.</param> void CloseQueryCommand(IDbCommand cmd, IDataReader reader); *************** *** 57,66 **** IDbCommand PrepareCommand(SqlString sql); - //TODO: how applicable is this??? /// <summary> /// Close a IDbCommand opened using <c>PrepareStatement()</c> /// </summary> ! /// <param name="cm"></param> ! void CloseCommand(IDbCommand cm); /// <summary> --- 53,62 ---- IDbCommand PrepareCommand(SqlString sql); /// <summary> /// Close a IDbCommand opened using <c>PrepareStatement()</c> /// </summary> ! /// <param name="cm">The <see cref="IDbCommand"/> to ensure is closed.</param> ! /// <param name="reader">The <see cref="IDataReader"/> to ensure is closed.</param> ! void CloseCommand(IDbCommand cm, IDataReader reader); /// <summary> *************** *** 98,102 **** void CloseCommands(); ! IDataReader GetDataReader(IDbCommand cmd); /// <summary> --- 94,117 ---- void CloseCommands(); ! /// <summary> ! /// Gets an <see cref="IDataReader"/> by calling ExecuteReader on the <see cref="IDbCommand"/>. ! /// </summary> ! /// <param name="cmd">The <see cref="IDbCommand"/> to execute to get the <see cref="IDataReader"/>.</param> ! /// <returns>The <see cref="IDataReader"/> from the <see cref="IDbCommand"/>.</returns> ! /// <remarks> ! /// The Batcher is responsible for ensuring that all of the Drivers rules for how many open ! /// <see cref="IDataReader"/>s it can have are followed. ! /// </remarks> ! IDataReader ExecuteReader(IDbCommand cmd); ! ! /// <summary> ! /// Executes the <see cref="IDbCommand"/>. ! /// </summary> ! /// <param name="cmd">The <see cref="IDbCommand"/> to execute.</param> ! /// <returns>The number of rows affected.</returns> ! /// <remarks> ! /// The Batcher is responsible for ensuring that all of the Drivers rules for how many open ! /// <see cref="IDataReader"/>s it can have are followed. ! int ExecuteNonQuery(IDbCommand cmd); /// <summary> *************** *** 106,109 **** --- 121,134 ---- void AbortBatch(Exception e); + /// <summary> + /// Generates an <see cref="IDbCommand"/> from a <see cref="SqlString"/>. + /// </summary> + /// <param name="sqlString">The <see cref="SqlString"/> to use to generate an <see cref="IDbCommand"/>.</param> + /// <returns>An <see cref="IDbCommand"/> that is not attached to a Connection or Transaction.</returns> + /// <remarks> + /// A wrapper for calling the <c>IDriver.GenerateCommand</c> that adds logging. + /// </remarks> + IDbCommand Generate(SqlString sqlString); + } } |