Transactions qn
1 posts in topic
Flat View  Flat View

Posted By:   neal_ravindran
Posted On:   Wednesday, November 13, 2002 05:49 AM

I am using a Stateless Session Bean(SSB) function which has been set with a transaction attribute of 'Required'. Say within this function there is a call to another function in an object which in turn calls another function in my DAO(data access objects) class. Like this visually:-

updateXXX() in SSB--->update() in object-->update() in DAO

Qn:-Will the transaction attribute of 'Required' be passed along(ie propagated)?

Re: Transactions qn

Posted By:   Bozidar_Dangubic  
Posted On:   Wednesday, November 13, 2002 09:12 AM

this will all run in a transaction. transaction attributes are not propagated, though. if you are in SLSB and invoking a method with transaction attribute set to REQUIRED then you can guarantee that the method will run in the transaction. if the method invokes another method and that object invokes another method, that operation will run in a transaction unless you are invoking some other EJB that may have a transaction attribute like RequiresNew in which case new transaction will be created until that method returns to the caller. Overall, in your example, entire method invocation will run inside a transaction.
About | Sitemap | Contact