• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

MDB tranx attribute ?

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
Why cant a MDB have a transaction attribute as "Never" ?.

Thanks
Arun
 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Definition of 'Never':
If an invoked method has no transaction context, run the method in an unspecified transaction contxet. If the method has an existing transaction, throw RemoteException/EJBexception to the remote/local client.

As you might know, MDBs have no clients. Who will handle the RemoteException/EJBException if thrown by the container?
[ March 25, 2005: Message edited by: Keerthi P ]
 
arunij katiliyar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Definition of 'Never':
If an invoked method has no transaction context, run the method in an unspecified transaction contxet. If the method has an existing transaction, throw RemoteException/EJBexception to the remote/local client.

As you might know, MDBs have no clients. Who will handle the RemoteException/EJBException if thrown by the container?

MDBS are triggered by the arrival of the message on the respective destinations so the onMessage block will always be triggered in isolation so the if part never arises in MDB's run time . The onMessage block can run with no transaction.

The conclusion is that it doesnt make sense for MDBs to have rather than your statement because your statement leaves a room of possibility .

" Who will handle the RemoteException/EJBException if thrown by the container?"

Thanks
Arun
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Arun,
I think Keerthi is right, please consider the behaviour of Never....if there is No Tx context, called Method will run in Unspecified Tx, but if there is a context, Client will get an exception...so now client is never existant for MDB's, and thats what keerthi means...who will handle the exception...its contradiction....so both if's apply to mdb's.
Makes sence...!!!

Amol.
 
It is no measure of health to be well adjusted to a profoundly sick society. -Krishnamurti Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic