We have two methods in Session Bean: A() and B().
A() and B() are called from another function in struts action class.
A() and B() saves and updates data using hibernate.
We want A() and B() operation to be atomic.
That is if A() passes but B() fails, updates done by A() should be rolled back and vice versa.
We want to use the J2EE framework, not the hibernate framework to do it.
session.beginTransaction and tx.commit/tx.rollback should not be used.
Can we do it using context.setRollbackOnly()?
If not can u suggest some way?
|