• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MDB tranx attribute ?

 
arunij katiliyar
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
 
Keerthi P
Ranch Hand
Posts: 203
  • 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
 
amol deshpande
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic