• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is my application transaction can propagate the LIferay service layer transaction on rollback?

 
suresh dasari
Ranch Hand
Posts: 121
Chrome Eclipse IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am working on an application that uses liferay framework. There is a registration portlet that registers the user in liferay and also inserting an entry into my application database mapping table with the liferay userid.
I want both tasks should be in one transaction only, if my mapping table entry fails I want to revert back the user creation in liferay.
Can I have a transaction in my application by overriding the liferay's transaction to rollback for my own exception?

any help is appreciated.

thanks,
Suresh.
 
Guy deLyonesse
Ranch Hand
Posts: 200
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're familiar with Liferay's Service Layer then you can use that to perform CRUD operations on entities like User in Liferay's configured database. If you use the built-in methods to create a user in order to generate the new userId, you can subsequently delete the user if the mapping table operation fails.
 
abhinav ladani
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey

Its simple in lifeay if you want to add or register new user you can use "UserLocalServiceUtil.addUser(, ,,,,,) "method.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic