dcsimg
calling multiple entity beans inside a session bean using transaction management
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Wednesday, April 10, 2002 06:11 AM

I am trying to call two entity beans inside a session bean for this iam setting "TransactionRequired" property for all the three beans, and the two entity bean calls iam putting inside a try block and in all catch blocks, rolling back the transaction using "getSessionContext().setRollBackOnly()"


for this it is throwing the following exception


javax.transaction.TransactionRolledbackException


and nothing has been updated inside database.

Re: calling multiple entity beans inside a session bean using transaction management

Posted By:   raza_shah  
Posted On:   Thursday, April 11, 2002 10:57 AM

hi

probably whts happening here tht somewhere after calling the setRollBackOnly() ure code is again calling setRollBackOnly().
tht y this transcation is being thrown.
eg

sessionMethod(){
try{
entityBean1.method();
entityBean2.method();
}catch(exception e){
//now the following would throw TransactinoRolledBack exception if transaction is already rolledback/set for roll back in either of the entityBean
context.setRollBackOnly();
}


}//end of sessionMethod


hope this helps

rgds

About | Sitemap | Contact