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 » HConn with Binding mode

Post new topic  Reply to topic
 HConn with Binding mode « View previous topic :: View next topic » 
Author Message
MrMQ9
PostPosted: Sun Mar 29, 2009 4:59 pm    Post subject: HConn with Binding mode Reply with quote

Newbie

Joined: 19 Dec 2008
Posts: 7

Dear MQ Gurus,

I am using MQ 7.0 in Windows 2003.
One of the application the MQ client running remotely have now moved in to the same machine as the MQ server is running on. This MQ client was running fine with the remote connection when it is not in the MQ server. But now I want to use Binding mode in the local server to make this application directly connect to the MQ manager. However I got error in HConn, the value of the HConn is 1. It looks to me it is not the correct value.

We are using C#.

What is the correct way of using Binding mode so that it returns a correct value of the HConn?

Your help is much appreciated.

Thanks
Back to top
View user's profile Send private message
bruce2359
PostPosted: Sun Mar 29, 2009 5:39 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Quote:
One of the application the MQ client running remotely have now moved in to the same machine as the MQ server is running on. This MQ client was running fine with the remote connection when it is not in the MQ server.
But now I want to use Binding mode in the local server to make this application directly connect to the MQ manager. However I got error in HConn, the value of the HConn is 1. It looks to me it is not the correct value.

What error exactly? ReasonCode?
Quote:
We are using C#. What is the correct way of using Binding mode so that it returns a correct value of the HConn?

Did you recompile and rebind with the server bindings libraries?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
MrMQ9
PostPosted: Sun Mar 29, 2009 6:10 pm    Post subject: Reply with quote

Newbie

Joined: 19 Dec 2008
Posts: 7

Hi,

Thanks for the reply.
The reason code is 2018. And the value of the HConn is always 1 when running remote mode in the local MQ server machine.

Another question is when two clients are running from remote machine, they get the same value of HConn, eg. 5. What is the implication of having the same HConn values for this 2 clients? Our application developers worried about this 2 clients are access the same shared memory when the connection is established.

Thanks.

bruce2359 wrote:
Quote:
One of the application the MQ client running remotely have now moved in to the same machine as the MQ server is running on. This MQ client was running fine with the remote connection when it is not in the MQ server.
But now I want to use Binding mode in the local server to make this application directly connect to the MQ manager. However I got error in HConn, the value of the HConn is 1. It looks to me it is not the correct value.

What error exactly? ReasonCode?
Quote:
We are using C#. What is the correct way of using Binding mode so that it returns a correct value of the HConn?

Did you recompile and rebind with the server bindings libraries?
Back to top
View user's profile Send private message
bruce2359
PostPosted: Sun Mar 29, 2009 6:19 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

When did you receive the 2018? At MQCONN or MQOPEN? Somewhere else?
Is all your code in this one program? Or are you calling some other program to do MQOPENs or MQGETs?

Post the source-code here.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
MrMQ9
PostPosted: Sun Mar 29, 2009 8:00 pm    Post subject: Reply with quote

Newbie

Joined: 19 Dec 2008
Posts: 7

bruce2359 wrote:
When did you receive the 2018? At MQCONN or MQOPEN? Somewhere else?
Is all your code in this one program? Or are you calling some other program to do MQOPENs or MQGETs?

Post the source-code here.


The process is like this:

C# application -> MQCB (VC++)

The error is occurred when MQCB VC++ function. Because MQCB takes the HConn as parameter, but the value of this HConn is 1 which looks like an initial value before connection established.

So the problem seems that how to get a value HConn value in binding mode.

As previously asked, what do you guys think about two different clients getting the same value of HConn from connecting to the same channel of a MQ server?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Mar 29, 2009 9:00 pm    Post subject: Reply with quote

Grand High Poobah

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

You should not be passing Hcon too much from one app to the other, have each app open its own connection....
Remember to keep your hcon threadsafe otherwise you are going to run into more trouble than your bargained for.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
gbaddeley
PostPosted: Mon Mar 30, 2009 4:11 pm    Post subject: Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

The value of hcon is meaningless for you to look at. It is only of interest to MQ internally. Values like 1 could be quite valid and may even be the same value across multiple threads and processes but that doesn't imply they are actually on the same connection.

There are only 3 values that are exposed in cmqc.h :
/* Connection Handles */
#define MQHC_DEF_HCONN 0
#define MQHC_UNUSABLE_HCONN (-1)
#define contact admin (-3)

I would double-check your code and add some debugging just after calling MQCONN and just before calling MQCB to make sure the scope of your hcon is correct and as you expected.

It is irrelevant whether you are using client or bindings mode.
_________________
Glenn
Back to top
View user's profile Send private message
shashikanth_in
PostPosted: Mon Mar 30, 2009 7:30 pm    Post subject: Reply with quote

Centurion

Joined: 26 Feb 2009
Posts: 123

The piece of code where you are getting HConn and passing onto MQCB will be helpfull. I am assuming you are using WebSphere MQ .NET classes.
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 API Support » HConn with Binding mode
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.