• Post Reply Bookmark Topic Watch Topic
  • New Topic

NorSupportedException in BMT Stateful session beans

 
sid nagol
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
consider a business method in a stateful session bean with bean managed transaction

public void bussinessMethod()
{
UserTransaction ut = this.sessionContext.getUserTransaction();
ut.begin();
UserTransaction ut2 = this.sessionContext.getUserTransaction();
ut.begin();
}

is this code supposed to handle the transqaction related checked exceptiopns.
ut.begin() throws a javax.ejb.NotSupportedException which is a checked exception.
its obvious it must handle it, but i am asking to confirm that as none of the code samples i have looked at seems to be showing that.

thank you very much for you time, i really appreciate it.
sid
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You probably don't get the exception handling in the interest of code clarity. I would expect this code to throw NotSupportedException. This should be handled and setRollbackOnly() invoked.
 
Jesus Angeles
Ranch Hand
Posts: 2069
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are you sure it is defined as bmt? not cmt?
 
What are you doing? You are supposed to be reading this 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!