• 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 and transactions

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
I have a query about MDB Transaction in Headfirst EJB:

p. 508
MDB must complete a txn before the end of OnMessage()
p.516 (Q3c)
The container does not throw an error if onMessage returns before a txn is committed (or I assume rolledback)

So who exactly does insist that the OnMessage transaction must be completed in the method?
Many thanks!
Kenny
 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For the CMT, the transaction is linked with the message acknowledgement and therefore the container insists the transaction better be completed and otherwise it will have to rollback.
 
kenny lomax
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
thanks for that clarfication, but I am still unclear:
EJB law says the transaction must be completed (committed or rolledback) before OnMessage completes.
If we are using BMP, and have a
tx.begin
but no tx.rollback in the OnMessage method, who complains?

Is it the deployment, the container, no one?
Thanks
Kenny
 
Muthaiah Ramanathan
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kenny,

Hello
I have a query about MDB Transaction in Headfirst EJB:

p. 508
MDB must complete a txn before the end of OnMessage()
p.516 (Q3c)
The container does not throw an error if onMessage returns before a txn is committed (or I assume rolledback)

So who exactly does insist that the OnMessage transaction must be completed in the method?



Here p. 508: MDB must complete a txn before the end of OnMessage() refers to BMT. The spec says only stateful session bean is allowed to keep a transaction open - No one else has that previllege. It is insisted by the EJB2.0 spec and therefore the container doesn't allow it.


p.516 (Q3c): The container does not throw an error if onMessage returns before a txn is committed (or I assume rolledback) refers to CMT. The MDB will just rollback in this case - it will NOT throw any exception.
[ March 12, 2006: Message edited by: Muthaiah Ram ]
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Many thanks - all clear now
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic