File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

NorSupportedException in BMT Stateful session beans

sid nagol

Joined: Jul 28, 2005
Posts: 20
consider a business method in a stateful session bean with bean managed transaction

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

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.
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: 2068
are you sure it is defined as bmt? not cmt?
I agree. Here's the link:
subject: NorSupportedException in BMT Stateful session beans
It's not a secret anymore!