• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

StateFul ejbCreate

 
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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."
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic