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 API Support » Multiple Connections

Post new topic  Reply to topic Goto page Previous  1, 2
 Multiple Connections « View previous topic :: View next topic » 
Author Message
fjb_saper
PostPosted: Tue Jul 27, 2010 7:49 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

You need to check channel defaults in V7. I believe the new default is sharing up to 10 connections. This might give you those side effects.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Jul 27, 2010 8:36 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

fjb_saper wrote:
You need to check channel defaults in V7. I believe the new default is sharing up to 10 connections. This might give you those side effects.


I had considered that, but let's make sure that channel connections are being established in the first place...
Back to top
View user's profile Send private message
kumoyuki
PostPosted: Wed Jul 28, 2010 12:10 am    Post subject: Reply with quote

Newbie

Joined: 26 Jul 2010
Posts: 8

So I changed the channel "sharing conversations" value from 10 down to zero and it had no effect. I am still getting that lovely "6" for the MQHCONN returned from MQCONNX; the completion code and the reason code are always 0. I then ran the requested DISPLAY CONN and DISPLAY CHSTATUS queries (with sharing conversations set to 0 and after the second connection is established in the program) and got :

Code:

5724-H72 (C) Copyright IBM Corp. 1994, 2008.  ALL RIGHTS RESERVED.
Starting MQSC for queue manager peer.


dis conn(*)
     1 : dis conn(*)
AMQ8276: Display Connection details.
   CONN(101F484C20000001)
   EXTCONN(414D5143706565722020202020202020)
   TYPE(CONN)
AMQ8276: Display Connection details.
   CONN(101F484C20000501)
   EXTCONN(414D5143706565722020202020202020)
   TYPE(CONN)
AMQ8276: Display Connection details.
   CONN(101F484C20000601)
   EXTCONN(414D5143706565722020202020202020)
   TYPE(CONN)
AMQ8276: Display Connection details.
   CONN(101F484C20000C01)
   EXTCONN(414D5143706565722020202020202020)
   TYPE(CONN)
AMQ8276: Display Connection details.
   CONN(101F484C20000D01)
   EXTCONN(414D5143706565722020202020202020)
   TYPE(CONN)
AMQ8276: Display Connection details.
   CONN(101F484C20001201)
   EXTCONN(414D5143706565722020202020202020)
   TYPE(CONN)
AMQ8276: Display Connection details.
   CONN(101F484C2063C102)
   EXTCONN(414D5143706565722020202020202020)
   TYPE(CONN)
AMQ8276: Display Connection details.
   CONN(101F484C2063DE02)
   EXTCONN(414D5143706565722020202020202020)
   TYPE(CONN)
dis chstatus(SYSTEM.ADMIN.SVRCONN)
     2 : dis chstatus(SYSTEM.ADMIN.SVRCONN)
AMQ8417: Display Channel Status details.
   CHANNEL(SYSTEM.ADMIN.SVRCONN)           CHLTYPE(SVRCONN)
   CONNAME(192.168.107.177)                CURRENT
   STATUS(RUNNING)                         SUBSTATE(RECEIVE)


The EXTCONN fields all contain the text "AMQCpeer ", for those of you that do not wish to decode the ascii.

I am back to stumped.[/code]
Back to top
View user's profile Send private message
markt
PostPosted: Wed Jul 28, 2010 12:14 am    Post subject: Reply with quote

Knight

Joined: 14 May 2002
Posts: 508

The hconn value returned to your application code is unique within that process. If you did a second connect, then you'd get a different number. But there are no guarantees about uniqueness across processes. Any "uniqueness" is handled internally, not exposed to the application. At one time, the hconn was a pointer value. But that's not always true - it's often an index to internal arrays.
Back to top
View user's profile Send private message
kumoyuki
PostPosted: Wed Jul 28, 2010 12:41 am    Post subject: Reply with quote

Newbie

Joined: 26 Jul 2010
Posts: 8

I have to correct my assertion that I am always getting MQCC_OK/MQRC_NONE back from the MQCONNX call. I don;t know what has been fogging my mind, but I note now that on the second and subsequent calls I get MQCC_WARNING/MQRC_ALREADY_CONNECTED, so I have in fact been told by the API that it is re-using the connection.

At this point I consider it a bug in MQ that the API does not reference count the connection if it is re-using the handle. Really, that's just wrong, and really easy to fix on MQ's side.

...proceeding to finish implementing my own reference counting scheme...
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jul 28, 2010 4:04 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

kumoyuki wrote:
At this point I consider it a bug in MQ that the API does not reference count the connection if it is re-using the handle. Really, that's just wrong, and really easy to fix on MQ's side.


Time for a PMR. Make the world a better place for future generations (and save yourself some code if it's really a quick & easy fix!).
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mvic
PostPosted: Sat Jul 31, 2010 2:29 pm    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

kumoyuki wrote:
At this point I consider it a bug in MQ that the API does not reference count the connection if it is re-using the handle. Really, that's just wrong, and really easy to fix on MQ's side.

MQ does not need to reference count the HConn in this example because there is still only one reference. Your rc of MQRC_ALREADY_CONNECTED indicates you already have a connection to the named queue manager, and the HConn is returned to you. You only need to call MQDISC once to disconnect that HConn - this is another proof that there is no reference counting needed, either by your code or by MQ code.

Will shared HConns help you out here? See http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzal.doc/fg12070_.htm
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » IBM MQ API Support » Multiple Connections
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.