From: Michael D. <mik...@us...> - 2004-09-14 17:50:05
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11256/Loader Modified Files: Loader.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. Index: Loader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader/Loader.cs,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Loader.cs 2 Sep 2004 15:13:35 -0000 1.34 --- Loader.cs 14 Sep 2004 17:49:56 -0000 1.35 *************** *** 674,693 **** { log.Info(st.CommandText); ! //TODO: H2.0.3 - uses session.Batcher.GetResultSet(st) instead ! // of directly executing the reader - the Batcher can be smarter ! // about when to wrap the IDataReader in an NDataReader ! rs = st.ExecuteReader(); ! ! //TODO: make this a much smarter implementation that looks at the Type ! // that is being loaded and determines wether or not to wrap this IDataReader ! // in a NDataReader. I believe the problem of multiple readers being opened ! // are occuring in <composite-id> with <many-to-one> and <component> with ! // a <collection>, <many-to-one>, and <one-to-one> inside of them. I believe ! // this is caused when the NullSafeGet() method calls other methods that can ! // potentially perform a Load of another object. ! if(!session.Factory.ConnectionProvider.Driver.SupportsMultipleOpenReaders) ! { ! rs = new Driver.NDataReader(rs); ! } if( !UseLimit(selection, session.Factory.Dialect) ) --- 674,678 ---- { log.Info(st.CommandText); ! rs = session.Batcher.ExecuteReader( st ); if( !UseLimit(selection, session.Factory.Dialect) ) |