Win a copy of AWS Security this week in the Cloud/Virtualization 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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."
 
He's giving us the slip! Quick! Grab this tiny ad!
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic