Reputation: 2401
we have a asp.net webforms app using NHibernate. Here are some specifics:
So basically, what happens is this (pseudocode):
using(var session = sessionFactory.CreateSession()){
using(var tx1 = new TransactionScope(){
//work work work
tx1.Complete();
}
//other work
using(var tx2 = new TransactionScope(){
//work work work
tx2.Complete();
}
}
However we now get into a situation where we see a lot of crashes related to the Connection to the database. Some researching gave us two suggestions:
However, we have two questions about these suggestions:
Upvotes: 3
Views: 402
Reputation: 6478
Have a look at the ncommon framework, it demonstrates a method of using NHibernate with a TransactionScope using the concept of a UnitOfWorkScope
; this may be the guidance that you're looking for.
Upvotes: 0
Reputation: 52745
session.BeginTransaction()
)Upvotes: 4