Win a copy of Head First Android this week in the Android forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

spanning txns across multiple business methods

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to HFEJB, page 301 (point 5):

Bean rums multiple business methods in the same transaction



Question: Since Entity beans use CMT, and in CMT, a txn is committed/rolledback after each method call, how is it possible to span transactions across mutiple business methods ?
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Sankar,
may be if you read page 356 it might clear your doubt.
see you can call a method within a method. say there are 3 methods, A ,B and C with CMP. so if method A which is running in a transaction 1 will call method B and C both. Then both the methods run in the same transaction 1. ok.
for more detail in Transaction please read chapter 9 EJB Transaction.
this might definitely help you.
cheers
Vikas Prasad
SCJP 1.4 SCWCD 1.4 SCBCD 1.3
 
Sankar Subbiramaniam
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I meant: "spanning txns across multiple client calls".
This to do with the different commit options supported by EJB spec.
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For a stateful session bean, it's possible to start a transaction in one method but end it in another method. This is almost never the right thing to do even though it is allowed by the EJB spec.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic