• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

StateFul ejbCreate

 
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. What's happen when i try to commit in ejbCreate method for BMT, Can i use method on UserTransaction in ejbCreate method on BMT stateful.
2. For CMT Can i use get or setRollbackOnly() on SessionContext in ejbCreate
Thank you
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can find answers to these questions in the EJB specification 2.0
1. What's happen when i try to commit in ejbCreate method for BMT, Can i use method on UserTransaction in ejbCreate method on BMT stateful.
Section 7.6.1, Table 2: Stateful BMT session beans are allowed to invoke methods on the UserTransaction interface within the ejbCreate method
2. For CMT Can i use get or setRollbackOnly() on SessionContext in ejbCreate
Section 7.6.1, Table 2: Stateful CMT session beans are not allowed to invoke setRollbackOnly() on the SessionContext interface within the ejbCreate method
 
Weerawit Maneepongsawat
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for quick reply.
but i want to know why in container point of view. Can anyone help me pls..
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Because according to the specs "The ejbCreate<METHOD>, ejbRemove, ejbPassivate, and ejbActivate methods
of a session bean with container-managed transaction demarcation execute with an unspecified
transaction context."
 
Creativity is allowing yourself to make mistakes; art is knowing which ones to keep. Keep this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic