aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes transaction in stateless session bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "transaction in stateless session bean" Watch "transaction in stateless session bean" New topic
Author

transaction in stateless session bean

anil bisht
Ranch Hand

Joined: Nov 04, 2000
Posts: 81
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: transaction in stateless session bean
 
Similar Threads
Default transaction context
BMT not propogated to invoked beans
list shuttle exception
Struts2 wizard with scoped model driven
Stateful session bean with Bean Managed Transaction