Forums Register Login

transaction in stateless session bean

+Pie Number of slices to send: Send
Hi,
I have a bean which calls three methods. these three methods are written in three differnet beans and all the three updates three different tables in a single database. Can i manage transaction if i use bean managed transaction
all the beans are stateless..
public class Callerbean{
public void updateThreeTables(){
begin transaction // using the transaction apis
//instanciate bean1 and call updateTableOne
boolean blnRaturn = bean1.updateTableOne()
if (!blnReturn) rollback transaction
//instanciate bean2 and call updateTableTwo
blnRaturn = bean2.updateTableTwo()
if (!blnReturn) rollback transaction
//instanciate bean3 and call updateTableThree
blnRaturn = bean3.updateTableThree()
if (!blnReturn) rollback transaction
else commit transaction
}
}
will it work ??
and if i use the container managed transaction then what do i need to do ???
Regards,
Anil
What a stench! Central nervous system shutting down. Save yourself tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 702 times.
Similar Threads
Default transaction context
BMT not propogated to invoked beans
Stateful session bean with Bean Managed Transaction
Struts2 wizard with scoped model driven
list shuttle exception
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 20:33:14.