Beginner |
 |
Joined: Wed May 02, 2007 12:24 am Posts: 41
|
Hello,
I'm trying to mix nHibernate & Ado.Net transaction, is it possible? Here is the psudo code:
trx = mySession.BeginTransaction();
//do some hibernate stuff with mySession
IDBCommand cmd = mySession.Connection.CreateCommand();
cmd.CommandText = rawSql;
cmd.ExecuteNonQuery();
//some other stuff
trx.Commit();
I'm getting an exception from ADO when I do ExecuteNonQuery telling me that the command requires a transaction.
How can I assign the existing transaction (trx) to the Command (cmd).
I guess I could do cmd.Transaction = mySession.Connection.BeginTransaction();
But that's a new transaction.
Is there a way I can get around this?
Thanks
|
|