I have a session bean which will invoke the create methods of 3 CMP Entity Beans as follows.
CMPBean1.create(param1,param2...);
CMPBean2.create(param1,param2...);
CMPBean3.create(param1,param2...);
These create statements should belong to one transaction. either all
should be inserted into their corresponding tables or neither of them.
do we have to start a transaction in the session bean if we have to
perform the above task?
-
Maintaining transactions (2 messages)
- Posted by: srinivas b
- Posted on: September 12 2001 01:08 EDT
Threaded Messages (2)
- Maintaining transactions by Gal Binyamini on September 12 2001 18:05 EDT
- Maintaining transactions by Alok Garg on September 18 2001 08:39 EDT
-
Maintaining transactions[ Go to top ]
- Posted by: Gal Binyamini
- Posted on: September 12 2001 18:05 EDT
- in response to srinivas b
The easiest way is to use container managed transactions. Just set the transaction attribute of the method that triggers these create calls to "Required" and everything will work.
If for some reason you have to use bean managed transactions, a transaction should be in scope when you call the create methods.
Gal -
Maintaining transactions[ Go to top ]
- Posted by: Alok Garg
- Posted on: September 18 2001 08:39 EDT
- in response to Gal Binyamini
Hello Gal,
I have question for you as I went through your ans on Transaction can you just explain it in more detail and also
how can we roll back all the transactions in Container managed transaction.
Alok