It's not a secret anymore!*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes NorSupportedException in BMT Stateful session beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "NorSupportedException in BMT Stateful session beans" Watch "NorSupportedException in BMT Stateful session beans" New topic
Author

NorSupportedException in BMT Stateful session beans

sid nagol
Greenhorn

Joined: Jul 28, 2005
Posts: 20
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

Joined: Sep 29, 2002
Posts: 1683
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.


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2057
are you sure it is defined as bmt? not cmt?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NorSupportedException in BMT Stateful session beans