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 » Cleaning up of JMS resources in a distributed transaction

Post new topic  Reply to topic
 Cleaning up of JMS resources in a distributed transaction « View previous topic :: View next topic » 
Author Message
Rclements
PostPosted: Thu Aug 01, 2002 12:25 pm    Post subject: Cleaning up of JMS resources in a distributed transaction Reply with quote

Novice

Joined: 20 Jun 2002
Posts: 18

I am using a stateless bean which writes messages to a queue. This activity takes place in a distributed transaction..

Q. Each message is part of some transaction, so I create a new session and sender at the begining of the log method. After queueSender.send(msg) occurs, when should queueSession.close(), queueSender.close() be called.
Back to top
View user's profile Send private message Send e-mail
amigupta1978
PostPosted: Thu Aug 01, 2002 10:22 pm    Post subject: Reply with quote

Centurion

Joined: 22 Jan 2002
Posts: 132
Location: India

hi,
is MQseries is acting as the contact admin coordinator or ur appserver is coordinating the transaction?
I think u can safely issue quesession.close() after the send call (in the same log method only) since u r creating a new instance every time ( to release the resources oustside JVM) This shud not affect ur transaction.


Regards,
Amit
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Rclements
PostPosted: Fri Aug 02, 2002 11:48 am    Post subject: Reply with quote

Novice

Joined: 20 Jun 2002
Posts: 18

The transaction is being coordinated via JTA, and someone in the calling chain is managing the UserTransaction.

Consequently, I can't issue the queuesession.close() in the same method, otherwise since the transaction has not been commited, it causes a rollback.

tried it before i posted

the only place that i can release the resources is when i go to establish a new queuesession (next time into the log method, I check to see if i have a queuesession, if i do, then i close it (the old one) and open a new one)

This works, but feels very wrong.
Back to top
View user's profile Send private message Send e-mail
kingdon
PostPosted: Mon Aug 05, 2002 9:54 am    Post subject: Reply with quote

Acolyte

Joined: 14 Jan 2002
Posts: 63
Location: UK

Sounds wrong to me too. What sort of connection factory are you using? It should be a WebSphere specific one (a WSQCF), not the generic QCF, the connections of which will have no knowledge of any XA transactions. Closing an XA aware session/connection should have no effect on the transactional state.

Regards,
James.
Back to top
View user's profile Send private message
Rclements
PostPosted: Tue Aug 06, 2002 3:45 am    Post subject: Reply with quote

Novice

Joined: 20 Jun 2002
Posts: 18

I am using a wsqcf in the JMSAdmin declaration.

Also, if I issue the queueSession close anywhere during the log method, the distributed transaction is rolled back (tried it).
Back to top
View user's profile Send private message Send e-mail
kingdon
PostPosted: Tue Aug 06, 2002 7:20 am    Post subject: Reply with quote

Acolyte

Joined: 14 Jan 2002
Posts: 63
Location: UK

My understanding is that it shouldn't be doing that. It would be worth just double checking that the code is using the connection factory you think it is, and if that doesn't turn up anything I'd suggest making a call to IBM support. They should be able to help diagnose the problem and work out where things have gone astray.

Regards,
James.
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 » Cleaning up of JMS resources in a distributed transaction
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.