It seems that a new session is created at the beginning of each new transaction and closed at the end. Is it possible to share the same session
if transactions are nested? Something like:
// ISOLATION_REQUIRED
doBusinessA()
{
A obj1 = loadById(3);
serviceA.doPart1(obj1) // ISOLATAION_REQUIRES_NEW
....
}
class A {
// ISOLATAION_REQUIRES_NEW
doPart1(A obj)
{
// setting values....
getHibernateTemplate().save(obj)
}
}


Reply With Quote