Foros de discusión

Implementing Transaction

thumbnail
Sreejesh Pv, modificado hace 11 años.

Implementing Transaction

Junior Member Mensajes: 41 Fecha de incorporación: 27/11/12 Mensajes recientes
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