Foren

Transactions in custom service no related with database

Pawel K, geändert vor 11 Jahren.

Transactions in custom service no related with database

New Member Beiträge: 3 Beitrittsdatum: 09.01.12 Neueste Beiträge
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, geändert vor 11 Jahren.

RE: Transactions in custom service no related with database

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
If there's not persistence entity involved, you can use resourceURL
Pawel K, geändert vor 11 Jahren.

RE: Transactions in custom service no related with database

New Member Beiträge: 3 Beitrittsdatum: 09.01.12 Neueste Beiträge
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, geändert vor 11 Jahren.

RE: Transactions in custom service no related with database

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
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.