From: Michael D. <mik...@us...> - 2004-05-06 13:14:11
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22817/NHibernate/Loader Modified Files: Loader.cs Log Message: Removed hacks that were added because of multiple open IDataReaders throwing exceptions with MsSql. Index: Loader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader/Loader.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Loader.cs 30 Apr 2004 14:06:47 -0000 1.19 --- Loader.cs 6 May 2004 13:14:03 -0000 1.20 *************** *** 760,769 **** // of directly executing the reader IDataReader rs = st.ExecuteReader(); ! if( !UseLimit(selection, session.Factory.Dialect) ) { ! Advance(rs, selection, session); } ! return rs; ! } catch (Exception sqle) { --- 760,783 ---- // of directly executing the reader IDataReader 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) ) ! { ! Advance(rs, selection, session); ! } ! ! return rs; ! } catch (Exception sqle) { |