Fórumok
Implementing Transaction
Sreejesh Pv, módosítva 11 év-val korábban
Implementing Transaction
Junior Member Bejegyzések: 41 Csatlakozás dátuma: 2012.11.27. Legújabb bejegyzések
I have one Class which extends MVCPortlet
In that I am calling two methods of Service layer
1.MACLocalServiceUtil.addMAC(mac);
2.MSGRCPTLocalServiceUtil.addMSGRCPT(rcpt);
If there is some issue/exception while inserting/adding the second add method the entire transaction should roll back.
Is there any simple way to implement this in liferay.
like
setAutocommit(false) then call this methods
1.MACLocalServiceUtil.addMAC(mac);
2.MSGRCPTLocalServiceUtil.addMSGRCPT(rcpt);
if any exception
rollback
if no exception
commit
In that I am calling two methods of Service layer
1.MACLocalServiceUtil.addMAC(mac);
2.MSGRCPTLocalServiceUtil.addMSGRCPT(rcpt);
If there is some issue/exception while inserting/adding the second add method the entire transaction should roll back.
Is there any simple way to implement this in liferay.
like
setAutocommit(false) then call this methods
1.MACLocalServiceUtil.addMAC(mac);
2.MSGRCPTLocalServiceUtil.addMSGRCPT(rcpt);
if any exception
rollback
if no exception
commit