NHibernate 2.10 Alpha2 breaks nearly all my tests as most of my tests use a
single transaction that spans multiple ISession.
The following test code works fine with NHibernate 2.0.1 GA :
using (var tx = new System.Transactions.TransactionScope()) {
using (ISession s = sessionFactory.OpenSession()) {
s.Flush();
}
using (ISession s = sessionFactory.OpenSession()) {
s.Flush();
}
//and I always leave the transaction disposed without calling
tx.Complete(), I let the database server to rollback all actions in this
test.
}
But in NHibernate 2.10 Alpha2 I get "System.InvalidOperationException:
Disconnect cannot be called while a transaction is in progress."
I put a issue on http://nhjira.koah.net/browse/NH-1744
ISession is originally designed to span multiple transactions, but some
times we want a transaction span multiple sessions.
If ISession represents a UnitOfWork, enabling the TransactionScope span
multiple sessions will make the "UnitOfWork" compositable. The higher layer
in the application will have a chance to composite multiple "UnitOfWork"s in
the lower layer to be a composite "UnitOfWork".
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---