Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

BMT Transaction

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Cowgirl and Author
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Container will throw a javax.transaction.NotSupportedException from the begin() method if the previous transaction has not completed.

cheers,
Kathy
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Space pants. Tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic