Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DB update using CM transaction (EJB 2.0) not getting affected in table.

 
Arvind Choudhary
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

To put it simple I have an MDB (M , Trans attr is not supported ) -> calling to SLSB (Trans attr is required) execute method -> giving call to anoter local method of bean.
Requirement : Customer and Account Termination(update flag in DB for this).
Condition : Customer can only be terminated in DB only when it has no active accounts.

Termination message is being received in order as seperate JMS messages i.e 1st Account Termination and then after one second Customer Termination message is being received by system.
Now in the logs I can see the account termination flg is updated in db by printing update count and after that customer termination message is being processed.
But before terminating cusomer when program fires query for active account check it gets the count as 1. I guess the update for A/C termination is still not commited.

Flow :
customer/Account termination JMS msg sent to MDB (M - onMessage()) -> SLSB execute() (if else for customer & account message to bifercate the flow).

I have already tried with changing the trans attr to requirs new for each of the customer/account update method keeping these in the remote interface. Also at MDB level as required.

CM stand for Container Managed Trans.
Please suggest what is going wrong ?
 
Arvind Choudhary
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ranchers, awaiting for your reply. Thanks.
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arvind Choudhary wrote:Ranchers, awaiting for your reply. Thanks.

PatienceIsAVirtue. Please EaseUp
 
Dieter Quickfend
Bartender
Posts: 543
4
Java Netbeans IDE Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post a representative class to compare with your MDB and SLSB?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic