Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do transactions work with BMP Entity Beans?  RSS feed

 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Since Entity Beans are forced to have CMT, and the commit, setAutoCommit, and rollback methods of java.sql.Connection aren't allowed in CMT, how does a BMP entity bean recover from a failed call to ejbStore or ejbCreate after partial completion? Is ejbStore of BMP entity beans not allowed to have more than one database-modifying call?

Thank you,
Yuriy
 
James Carman
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you wish to let the container know that something has gone wrong and you don't want to throw a runtime exception, you can access the UserTransaction through your context object and call setRollbackOnly().
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!