[OFBiz] Users - Transaction rollbacks

Ryan Warnick warnickr_1 at isp01.net
Mon Apr 4 19:02:05 EDT 2005


Is your entire simple-method wrapped in a transaction?  The easiest way
to do this is to make it a service.  By default, a service forces
everything that a service does to be wrapped in a transaction.  This
means that it will create a new transaction if one doesn't already
exist.  The other thing that could cause this to happen even if the
outer simple-method is wrapped in a transaction is if every service call
in the simple-method is wrapped in its own transaction
(require-new-transaction = "true").  In either case, a failure in one
service call wouldn't cause the all of the work done in the
simple-method to roll back.  Based on my experience with the services
that you are referring to, I would say that your problem is the latter.

Ryan

-----Original Message-----
From: users-bounces at lists.ofbiz.org
[mailto:users-bounces at lists.ofbiz.org] On Behalf Of Ashish Hareet
Sent: Monday, April 04, 2005 3:42 PM
To: users at lists.ofbiz.org
Subject: [OFBiz] Users - Transaction rollbacks


I've made a form that creates a person, a login & password for the
person & some other data like addresses & phone numbers.

The simple-method first creates the person & login using the existing
"createPersonAndUserLogin" from the party manager application & then
creates the corresponding addresses, etc using services -
createPartyPostalAddress & createPartyTelecomNumber.

The problem is that if creation of addresses or telephone numbers fails
for some reason, the person & login is still created. Uptill now I was
under the impression that even 
if one part inside a simple-method fails, the entire process is
rolledback, which my 
simple-method is not doing.

The funny thing is if I try to create a person without login(using
createPerson), & some errors result in addresses or telephone numbers,
the entire transaction is rolled back i.e. no person is created at all.

What is special about createPersonAndUserLogin that prevents my methods
from rolling back completely ?

Are there some steps I need to take to ensure that the transaction is
rolledback ?

Appreciate your help
Ashish Hareet
 
_______________________________________________
Users mailing list
Users at lists.ofbiz.org http://lists.ofbiz.org/mailman/listinfo/users



__________ NOD32 1.1045 (20050404) Information __________

This message was checked by NOD32 antivirus system. http://www.nod32.com




More information about the Users mailing list