we're using Burrow in our project and recently we had to upgrade to NHibernate 2.1 because it added functionality we really needed. Everything went (semi-)smooth until all the pieces came together. Let me explain our situation:
We use manual transaction management, because we need to use Transactionscopes (which is now properly supported in NHibernate). In certain conditions, we got the following error: "Disconnect cannot be called while a transaction is in progress."
A little google search revealed that this exception is triggered by calling session.Close() instead of session.Dispose() to end a session when using Transactionscopes.
The following patch implements this change in Burrow:
Hi,
we're using Burrow in our project and recently we had to upgrade to
NHibernate 2.1 because it added functionality we really needed.
Everything went (semi-)smooth until all the pieces came together. Let
me explain our situation:
We use manual transaction management, because we need to use
Transactionscopes (which is now properly supported in NHibernate). In
certain conditions, we got the following error: "Disconnect cannot be
called while a transaction is in progress."
A little google search revealed that this exception is triggered by
calling session.Close() instead of session.Dispose() to end a session
when using Transactionscopes.
The following patch implements this change in Burrow:
Index: SessionAndTransactionManager.cs
===================================================================
— SessionAndTransactionManager.cs (revision 935)
+++ SessionAndTransactionManager.cs (working copy)
@@ -68,7 +68,7 @@
return;
if (session.IsOpen)
session.Close();
+ session.Dispose();
session = null;
}
Cheers,
Lodewijk