Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

2 questions about exceptions

 
Tontang Bei
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. A bean realizes it cant commit a tx, but it doesnt want the client to get an exception. what can the bean do?

2. A bean wants the client to get an application exception, but the bean still wants the tx to commit. What should the bean do?

The above 2 are from the K&B. I cant find the answers. Please help

Thanks
 
Tridib Samanta
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. The bean will call EJBContext.setRollbackOnly().
2. Application exception does not cause rollback automatically. So the bean can just throw the exception back to the client.

Thanks
Tridib
 
Tontang Bei
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tridib
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic