• 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
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!