留言板

Transactions in custom service no related with database

Pawel K,修改在11 年前。

Transactions in custom service no related with database

New Member 帖子: 3 加入日期: 12-1-9 最近的帖子
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,修改在11 年前。

RE: Transactions in custom service no related with database

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
If there's not persistence entity involved, you can use resourceURL
Pawel K,修改在11 年前。

RE: Transactions in custom service no related with database

New Member 帖子: 3 加入日期: 12-1-9 最近的帖子
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,修改在11 年前。

RE: Transactions in custom service no related with database

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
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.