• 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

CMT Transaction

 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In FHEJB p509,

CMT transaction cannot stay open across multiple method invoation from a stateful session client (BMT transaction can).


Don't quite understand the above statement. Someone can explain?
 
Ranch Hand
Posts: 390
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Simple; CMT can not be demarcated by the bean developer. In CMT a method specified in a transaction attribute is wholly involved in the trnsaction but in BMT the programmer can demarcate a transaction - he gets the transaction with a command such as ut = context.getUserTransaction() the transaction starts when he issues the command ut.begin(). He could decide not to commit or rollback the transaction in the same method, rather he does that in a different method. Now the down side is one can not say for sure which of the methods is going to be called first.
 
Alibabra Sanjie
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anselm Paulinus, your answer focus on BMT, but my question is mainly about CMT - the main sentence.
 
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The client can call a method (on a CMT bean), and it might start a transaction. The bean might even call other methods that start other transactions (but no nested transactions, of course). In the end, when that original method from the CMT bean ends, there must be no transactions open. The container manages that. Think about your DD.... you had to tell it to use CMT for that bean. You also had to tell it how you wanted it to handle transactions (Required, Not Supported, etc). There's nothing in the DD to say "leave this one open at the end of the method", right?
--Dale--
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic