• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setRollbackOnly() is ejbCreate()

 
Mohammed Eesa
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any explain me why method setRollbackOnly() of Context Object cannot be invoked on ejbCreate(),Eventhough ejbCreate() will always run in transaction context of which create().
 
Vagner Freitas
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mohammed.

setRollbackOnly() can be called only by CMT beans. But for setRollbackOnly() to work, the method must be in a transaction.
The create and remove methods of session bean are not considered part of a client's transaction (unlike the way it works with entity beans).
I guess it help you.

Vagner
 
SamyV VenkatS
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, all the container rollbacks run in unspecified transaction context...meaning no rule that applies to transaction can be applied..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic