From: Michael D. <mik...@us...> - 2004-08-28 04:07:37
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28447/src/NHibernate/Impl Modified Files: SessionFactoryImpl.cs Log Message: Added code so BeginTransaction(IsolationLevel) works with hibernate.connection.isolation configuration Index: SessionFactoryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** SessionFactoryImpl.cs 19 Aug 2004 17:48:35 -0000 1.27 --- SessionFactoryImpl.cs 28 Aug 2004 04:07:04 -0000 1.28 *************** *** 77,80 **** --- 77,81 ---- [NonSerialized] private bool showSql; [NonSerialized] private bool useOuterJoin; + [NonSerialized] private IsolationLevel isolation; // TODO: figure out why this is commented out in nh and not h2.0.3 //[NonSerialized] private Templates templates; *************** *** 145,148 **** --- 146,173 ---- log.Info("use outer join fetching: " + useOuterJoin); + // default the isolationLevel to Unspecified to indicate to our code that no isolation level + // has been set so just use the default of the DataProvider. + string isolationString = PropertiesHelper.GetString( Cfg.Environment.Isolation, properties, String.Empty ); + if( isolationString!=String.Empty ) + { + try + { + isolation = (IsolationLevel)Enum.Parse( typeof(IsolationLevel), isolationString ); + log.Info( "Using Isolation Level: " + isolation.ToString() ); + } + catch( ArgumentException ae ) + { + log.Error( "error configuring IsolationLevel " + isolationString, ae ); + throw new HibernateException( + "The isolation level of " + isolationString + " is not a valid IsolationLevel. Please " + + "use one of the Member Names from the IsolationLevel.", ae ); + } + } + else + { + isolation = IsolationLevel.Unspecified; + } + + bool usrs = PropertiesHelper.GetBoolean(Cfg.Environment.UseScrollableResultSet, properties); int batchSize = PropertiesHelper.GetInt32(Cfg.Environment.StatementBatchSize, properties, 0); *************** *** 395,398 **** --- 420,428 ---- } + public IsolationLevel Isolation + { + get { return isolation; } + } + public QueryTranslator GetQuery(string query) { |