Hi
i have to create multiple record in a table in single transaction ( say 10 records).i am using session facade. i am looping in session bean and calling create method of entity bean ( 10 times) .my requirment is , if any of the record gives error, all 10 records should get rolled back.
what transaction attribute should i use.
Thanks in advance
Faisal
-
how to call ejbcreate more than once in single trans (2 messages)
- Posted by: Faisal Abdullah
- Posted on: August 04 2003 05:43 EDT
Threaded Messages (2)
- how to call ejbcreate more than once in single trans by Chris Turner on August 04 2003 06:26 EDT
- how to call ejbcreate more than once in single trans by Chetans on August 04 2003 07:09 EDT
-
how to call ejbcreate more than once in single trans[ Go to top ]
- Posted by: Chris Turner
- Posted on: August 04 2003 06:26 EDT
- in response to Faisal Abdullah
Your entity beans should have a transaction attribute of either Required or Mandatory. That way they are forced to use the transaction provided by the session facade and will roll back if the session facade transaction rolls back. The main thing is that you don't use RequiresNew, NotSupported or Never on your entity beans as these values will result in each ejb create being and isolated operation. -
how to call ejbcreate more than once in single trans[ Go to top ]
- Posted by: Chetans
- Posted on: August 04 2003 07:09 EDT
- in response to Chris Turner
I will suggest, whatever is ur transaction attribute, make sure that in case of any problem you are throwing EJBException. If that is happening all the work done within one transaction context will be rolled back.
Regards
Chetan