• 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

Transaction woes

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everybody.

I would really be thankful if somebody explained me how to solve this problem. It's purely transaction-related and I'm completely stuck.

I have a session bean OrderHandler, MDB beans BusinessPartnerHandler and BusinessProcessController, and an entities Order and OrderStatus. Scenario goes like this:

- MDB bean BusinessProcess Controller gets an Order, instansiates session bean OrderHandler and calls its method to store the Order
- OrderHandler stores the Order, sets its status to "Stored"
- after that OrderHandler sends a JMS message to BusinessPartnerHandler to order some stuff from business partners. The message contains Order ID.
- BPHandler orders the stuff, sets the Order status to "Items ordered"

Everything looks nice and all, but upon finishing the scenario the Order status is, quite impossibly, "Stored". I debugged it with println's, and it seems that the BPHandler somehow sets the order's status BEFORE the OrderHandler does his work, although it's definitely not possible if you follow the code flow.

How do I solve this thing? I know it's a play with transactional attributes but I honestly don't know which ones to use and on which bean. Every possible combination I tried doesn't work.

Please help me if you can. Thanks.
reply
    Bookmark Topic Watch Topic
  • New Topic