ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Problem with JMS/MQSeries transacted session

Post new topic  Reply to topic
 Problem with JMS/MQSeries transacted session « View previous topic :: View next topic » 
Author Message
jjversa
PostPosted: Fri Oct 24, 2003 12:01 pm    Post subject: Problem with JMS/MQSeries transacted session Reply with quote

Newbie

Joined: 24 Oct 2003
Posts: 3

I'm executing Java code on an IBM mainframe running z/OS and MQSeries 5.3, and am using a transacted session to send/receive messages. When no errors occur, naturally all's well--my sender writes the message in an uncommitted state, and I can commit it/roll it back as the situation warrants. When a handled exception occurs, things are still OK, in that I can catch the exception and yell for rollback() to bring us back to where we were before the message was sent.

My problem is what happens when an unhandled error condition stops the client application. In my shop, this scenario is usually tested by placing an unhandled zero-divide bomb in the code immediately after the message.send(). The client naturally blows up, and I would expect the theoretically uncommitted message to roll back. Instead, it commits. Can someone tell me why?

Thanks.

JJ
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Fri Oct 24, 2003 8:50 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

On your PUT, add the following pmo option: MQC.MQPMO_SYNCPOINT
Then on your abend, the message will be rollback.

later
Roger...
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
jjversa
PostPosted: Sat Oct 25, 2003 4:31 am    Post subject: Reply with quote

Newbie

Joined: 24 Oct 2003
Posts: 3

I'm familiar with the syncpoint MQPutMessageOption. Humor me for a moment, as our documentation is a bit sketchy here, but weren't the JMS message writes supposed to be done with send() rather than put()? Maybe we're barking up the wrong tree.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Sat Oct 25, 2003 9:07 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

I used "PUT" as a figure of speech. For Java, send() is the correct method.

Even if you are using a transactional client, you still need to set the syncpoint option. Otherwise the "PUT" is considered to be outside of the Unit Of Work.

later
Roger...
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
jjversa
PostPosted: Mon Nov 03, 2003 12:19 pm    Post subject: Follow-up Reply with quote

Newbie

Joined: 24 Oct 2003
Posts: 3

Since we had already been setting up a PutMessageOption containing SYNCPOINT, we knew that wasn't the trouble, so we had to dig a bit. Finally, someone found the following in an old IBM FAQ:

PartnerWorldibm.com <!-- Home | Products & services | Support & downloads | My accountIBM PartnerWorld > <!-- <!-- PartnerWorld for DevelopersTechnical > FAQs Frequently Asked Questions FAQ help Search tips Can you use Java programming with MQSeries to have a two-phase commit via RRS? A: MQSeries Java stubs are linked to the MVS batch stubs, not with the RRS stubs. Therefore, Java calls to MQSeries do not invoke RRS recovery routines. You would probably have to link to the C/C++ stubs which have been linked with the RRS stubs. Reference: 20839 / 22352 Date: 12 Sep 2002 Keyword: Java/JMS programming [ Return to main page ] About IBM | Privacy | Terms of use | Contact

Bottom line: Only a proper JMS to RRS (Resource Recovery Services) to MVS traversal will give you the automatic rollback support granted by full MVS abend, and the mainframe batch JVM (at least ours) is rigged to bypass RRS.

The two ways around this are either to:

1. Relay upward and catch all Throwables in all application main() methods, then call session.rollback() manually from within such catch blocks.

2. Relay upward and catch all Throwables in all application main() methods, then call an "abender" program written in C (which does have hooks into the RRS layer that handles abend-triggered rollback). This has the benefit of triggering all rollbacks (MQ, DB2, etc.) that MVS full abend can grant, not just solving the MQ problem.

JJ
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Problem with JMS/MQSeries transacted session
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.