Fórumok

Transactions in custom service no related with database

Pawel K, módosítva 11 év-val korábban

Transactions in custom service no related with database

New Member Bejegyzések: 3 Csatlakozás dátuma: 2012.01.09. Legújabb bejegyzések
Hi Liferay Community

I want to create a custom service which is not related to database. It provides some logic
which has to support transactions. Due the fact that service is not related with database I cannot
use service builder.

I will be appreciated for any help/hint/advice

thanks a lot
Pawel
thumbnail
Hitoshi Ozawa, módosítva 11 év-val korábban

RE: Transactions in custom service no related with database

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
If there's not persistence entity involved, you can use resourceURL
Pawel K, módosítva 11 év-val korábban

RE: Transactions in custom service no related with database

New Member Bejegyzések: 3 Csatlakozás dátuma: 2012.01.09. Legújabb bejegyzések
Thanks for your answer.

However I think some clarification of may problem is needed so I describe may use case more precisely.

I have created ext project which imports users from LDAP to Liferay.
Based on some data from LDAP some user groups and / or organization may be created.
Unfortunately sometimes process of creating and assigning users to user groups/ organization fails
and I have inconsistent data in the portal.

Is there any Liferay mechanism or mechanism which is used by Liferay, which can treat
a set of methods call as a transaction and in case of same failure rolls everything back??


BR
Pawel
thumbnail
David H Nebinger, módosítva 11 év-val korábban

RE: Transactions in custom service no related with database

Liferay Legend Bejegyzések: 14916 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Pawel K:
Unfortunately sometimes process of creating and assigning users to user groups/ organization fails
and I have inconsistent data in the portal.

Is there any Liferay mechanism or mechanism which is used by Liferay, which can treat
a set of methods call as a transaction and in case of same failure rolls everything back??


I don't believe it's the Liferay API that is failing and no, the individual calls cannot be 'rolled back' (adding a user, for example, writes the user to the index and the database and for this there is no concept of a rollback for this).

Instead you should figure out why your code is failing and fix it.