aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes MDB XA Transactions Behaviour Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "MDB XA Transactions Behaviour" Watch "MDB XA Transactions Behaviour" New topic
Author

MDB XA Transactions Behaviour

Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492
Hi

Am working on an ATM interface it behavior is

In Unix Machine I have my Oracle Database, Webphere MQ, and MDB running in OC4J Server am configured my MDB to Support XA transaction. In MQ bindings also I used XA.

Testing
-------
MDB is picking a Message from MQ and in the OnMessage() and manually throwing an Exception. So this means Unsuccessful Execution of Onmessage() and in the catch block am calling setrollbackonly.

<trans-attribute>Required</trans-attribute>

Behaviour
---------
After Picking 1st message from MQ in the Onmessage () am throwing an exception, Again the ejbcreate() is calling and then OnMessage() again the exception again ejbCreate(). It happens for 7 times. On the 8th time My MDB is picking the 2nd Message and I checked the MQ the 1st Message is not there. I lost the Message. Whether this is the Actual Behavior???

Please Assist Me. Thanks in Advance
[ October 15, 2008: Message edited by: Meet Gaurav ]
Kumar Subramanian
Greenhorn

Joined: Oct 01, 2008
Posts: 8
You can check the retry counts configured for your deployment


Subramanian, Kumar [kumar@eminenttech.com]<br />J2EE Architect, <a href="http://www.eminenttech.com" target="_blank" rel="nofollow">Eminent Technology Solutions (ETS)</a><br />Software / Portals / Alfresco / Outsourcing / Proteomics
Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492
Where Exactly. Am using OC4J Server 10.1.3

Any Specific File...
Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492
Am just testing this in Exception Case.. In Case the server crashes or Power Shut Down of the Server. What will happen ?? After some time If I started the server the Oc4j will process that message that message will still in the MQ Queue..

Am very curious to know how the server is working. Thinking in Different Angles

Please Assist Me
[ October 16, 2008: Message edited by: Meet Gaurav ]
Kumar Subramanian
Greenhorn

Joined: Oct 01, 2008
Posts: 8
Its container specific option. In your case it is orion-ejb-jar xml. I think param is max retry count or delivery count - am not sure - suggest you to check the syntax and usage of a config param before using.

Your MQ can retain the messages in the queue if the consumer (your MDB) is not available and these messages will get processed once the consumer is available.
Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492
HI Kumar,

In case if the server crashes whether the message will be on the Queue or in the Container itself..Because I tryed calling System.exit(0) inside OnMessage() and the server is shutting down.. And the message is not on the Websphere MQ Queue.

I used max-delivery-count="10" in Orion-ejb.jar. Still the MDB is picking that message for 5 Times only. At 6th time the message is not there..Could you please assist me.
[ October 17, 2008: Message edited by: Meet Gaurav ]
 
jQuery in Action, 2nd edition
 
subject: MDB XA Transactions Behaviour