• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

transaction in stateless session bean

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic