*
The moose likes EJB and other Java EE Technologies and the fly likes DB update using CM transaction (EJB 2.0) not getting affected in table. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "DB update using CM transaction (EJB 2.0) not getting affected in table." Watch "DB update using CM transaction (EJB 2.0) not getting affected in table." New topic
Author

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

Arvind Choudhary
Greenhorn

Joined: Jun 07, 2012
Posts: 15
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

Joined: Jun 07, 2012
Posts: 15
Ranchers, awaiting for your reply. Thanks.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10175
    
    8

Arvind Choudhary wrote:Ranchers, awaiting for your reply. Thanks.

PatienceIsAVirtue. Please EaseUp


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Dieter Quickfend
Bartender

Joined: Aug 06, 2010
Posts: 516
    
    4

Can you post a representative class to compare with your MDB and SLSB?


Oracle Certified Professional: Java SE 6 Programmer && Oracle Certified Expert: (JEE 6 Web Component Developer && JEE 6 EJB Developer)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: DB update using CM transaction (EJB 2.0) not getting affected in table.
 
Similar Threads
MDB transaction gets rollbacked without exception being logged
jms losing messages..
Service Activator - MDB / stand-alone JMS listeners?
Journal Article - Asynchronous queries in J2EE
JMS - benefits?