• 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

MDB tranx attribute ?

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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.
 
And then the entire population worshiped me like unto a god. Well, me and this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic