• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Ejb and JMS transactions as one automic transaction

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
We require JMS and EJB transactions together as one automic transaction such that we send a JMS message and try persisting the EJB (or do any database operation etc). If this proceeds without error then commit the JMS transaction Else rollback.

Similarly if the above commit of JMS fails then rolback the EJB transaction.

The session beans have no transaction tag so it will use the default which is supported.

Can we do this by using container Managed transactions OR do we have to do it manually using user transactions?

Please advise,
Regards,
Ashutosh
 
Ranch Hand
Posts: 354
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you use MDBs you can set a transaction attribute on onMessage() (i.e. Required) and delegate the message object to Session Bean which runs under the same tx context.
 
These are the worst of times and these are the best of times. And this is the best tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic