I want to use 2 functions with in each a transaction.
A() {
HibernateUtil.beginTransaction();
fctA();
HibernateUtil.commitTransaction();
}
B() {
HibernateUtil.beginTransaction();
fctB();
HibernateUtil.commitTransaction();
}
If I call A or B in a Session, no problem.
But if I call A and B in the same session, the commit in function B() commit the 2 transactions.
So I modified functions as follows:
A() {
HibernateUtil.currentTransaction();
fctA();
}
B() {
HibernateUtil. currentTransaction();
fctB();
}
Now, only one transaction is manipulated, but I don't known where to do the call to commit.
A and B are not transaction, because there are no commit in it.
http://www.dotnetguru.org/articles/doss ... apping.htm talk about a ServiceLocator to commit all transaction.
Thanks a lot for your answers.