This week's book giveaway is in the Cloud forum.
We're giving away four copies of The Business Blockchain and have William Mougayar on-line!
See this thread for details.
Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

StateFul ejbCreate

 
Weerawit Maneepongsawat
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
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • 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..
 
Sany Bel
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."
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic