From: Peter S. <sz...@us...> - 2004-04-06 10:31:38
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Id In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13383 Modified Files: IncrementGenerator.cs Log Message: Had to do an ugly hack, now it executes itself in parent transaction, this won't work under multithreaded conditions! Index: IncrementGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/IncrementGenerator.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IncrementGenerator.cs 6 Apr 2004 08:48:23 -0000 1.2 --- IncrementGenerator.cs 6 Apr 2004 10:18:50 -0000 1.3 *************** *** 9,12 **** --- 9,14 ---- using NHibernate.Util; + #warning Hack to run tests, should rework transaction handling + namespace NHibernate.Id { *************** *** 46,50 **** if(sql!=null) { ! GetNext( session.Connection ); } --- 48,52 ---- if(sql!=null) { ! GetNext( session.Connection, session.Transaction as Transaction.Transaction ); } *************** *** 70,74 **** #endregion ! private void GetNext(IDbConnection conn) { log.Debug("fetching initial value: " + sql); --- 72,76 ---- #endregion ! private void GetNext(IDbConnection conn, Transaction.Transaction transaction) { log.Debug("fetching initial value: " + sql); *************** *** 77,80 **** --- 79,83 ---- cmd.CommandType = CommandType.Text; cmd.CommandText = sql; + cmd.Transaction = transaction.AdoTransaction; cmd.Prepare(); |