File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes BMT Transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "BMT Transaction" Watch "BMT Transaction" New topic
Author

BMT Transaction

Sandesh Tathare
Ranch Hand

Joined: Jun 22, 2003
Posts: 82
BMT Transaction:
It's well known that a BMT bean(Stateless Session Bean or Message Driven Bean) must NOT complete a transactional method without ending the transaction.

I just want to know, what happens when a programmer miss on this. What type of exception is thrown by Container?


Regards,<br />Sandesh<br />(SCJCP, SCWCD, SCBCD - 99%, OCP-1)<br /> <br />Either find a way or create one.
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
The Container will throw a javax.transaction.NotSupportedException from the begin() method if the previous transaction has not completed.

cheers,
Kathy
Paul Maessen
Greenhorn

Joined: Sep 27, 2004
Posts: 12
According to the spec (17.6.1), for a SLSB a RemoteException or EJBException is thrown to the client.

For a MDB it doesn't make sense for the container to throw an exception (since there is no client to receive it).
Sandesh Tathare
Ranch Hand

Joined: Jun 22, 2003
Posts: 82
Kathy, thanks once again.

Let me summarise what I have understood below:

If Bean Provider do not complete a transactional method without ending the transaction of a BMT bean(Stateless Session Bean or Message Driven Bean):
1] Container do not throw any exception
2] Subsequently, if an attempt is made to begin new Transaction without first completing previous transaction, javax.transaction.NotSupportedException is thrown.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: BMT Transaction