|
Hi,
I am trying to manage transaction in ofbiz's java event. But it's not working properly. Given example of code:-
public static String myEvent(HttpServletRequest request,HttpServletResponse response){
try {
boolean beganTransaction = false;
beganTransaction = TransactionUtil.begin();
String result = myOtherEvent(modifiedrequest,response);
//here code for calling service, if service failed due to any reason then all transaction should be rollback but it's not behaving like this. "myOtherEvent" transactions is not rolling back.
TransactionUtil.commit(beganTransaction);
} catch(Exception e){
try {
TransactionUtil.rollback(beganTransaction, throwable.getMessage(), throwable);
} catch (GenericEntityException e2) {
}
}
}
|