Author |
Message
|
mqrules |
Posted: Mon Nov 12, 2007 2:15 pm Post subject: 2- phase commit possible? |
|
|
Centurion
Joined: 01 Jun 2005 Posts: 100 Location: US
|
"MQ Server" (not MQClinet) is installed on the server1 and qmgr QM1 is on the server2. Database is on server1.
If the MQ app/Weblogic is running on server1 connects to the QM1 qmgr on server2 via Client-connection, can the twoo-phase commit be possible? I think so as both of the servers have "MQ server", but would like to confirm with the forum.
Thanks for your help.
MR |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Nov 12, 2007 2:19 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
No.
You can only get 2PC with a bindings connection or an Extended Transactional Client Connection. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
EddieA |
Posted: Mon Nov 12, 2007 2:21 pm Post subject: Re: 2- phase commit possible? |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
mqrules wrote: |
If the MQ app/Weblogic is running on server1 connects to the QM1 qmgr on server2 via Client-connection, can the twoo-phase commit be possible? |
Only if you use the Transactional MQ Client, which I believe costs the same as an MQ Server.
The fact that there's an MQ Server running on the platform where your client is running (server1) is irrelevant, as you're not connecting to it.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
mqrules |
Posted: Tue Nov 13, 2007 11:35 am Post subject: |
|
|
Centurion
Joined: 01 Jun 2005 Posts: 100 Location: US
|
|
Back to top |
|
 |
TimothyV |
Posted: Mon Dec 17, 2007 11:41 pm Post subject: |
|
|
Novice
Joined: 17 Dec 2007 Posts: 17
|
jefflowrey wrote: |
No.
You can only get 2PC with a bindings connection or an Extended Transactional Client Connection. |
What is and how can i establish a bindings connection? |
|
Back to top |
|
 |
Vitor |
Posted: Tue Dec 18, 2007 1:41 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
TimothyV wrote: |
jefflowrey wrote: |
No.
You can only get 2PC with a bindings connection or an Extended Transactional Client Connection. |
What is and how can i establish a bindings connection? |
As a follow on from this:
http://www.mqseries.net/phpBB2/viewtopic.php?t=41091&highlight=
A bindings connection (sometimes called a server connection) is where the application runs on the same machine as the queue manager and "binds" to it via RPC rather than clients to it over TCP.
There are 3 types of connection in .NET IIRC - managed, client and server. You're using client, you need server. The .NET manual will be more authorative than me in this matter.
Remember - a server connected application has to run on the same machine as the queue manager. There are good reasons (architectually) why you might not want to do that.. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
TimothyV |
Posted: Tue Dec 18, 2007 2:11 am Post subject: |
|
|
Novice
Joined: 17 Dec 2007 Posts: 17
|
Vitor,
I tought i was using server:
Code: |
System.Collections.Hashtable properties = new System.Collections.Hashtable();
properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_BINDINGS);
|
[/quote] |
|
Back to top |
|
 |
Vitor |
Posted: Tue Dec 18, 2007 12:29 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
That looks like bindings to me.
Your other thread refered to "a client connection" hence the confusion. I don't know how .NET reacts if you select bindings on a machine with no queue manager but that's the setting.
I'd double check the queue manager & the database configuration for 2-phase commit. Which of them is the co-ordinator; I have a faint memory of rules about the queue manager coordinating or being coordinated in various circumstances.
The manual will be your friend here. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
TimothyV |
Posted: Tue Dec 18, 2007 11:17 pm Post subject: |
|
|
Novice
Joined: 17 Dec 2007 Posts: 17
|
Quote: |
I don't know how .NET reacts if you select bindings on a machine with no queue manager but that's the setting.
|
My machine has a queue manager. Like i said before, everything is installed on my local machine except the database. So my com+ component and everything from IBM Websphere is installed local.
I can make this work perfectly with different database actions, all in one transaction, it's only the communication with the queue that isn't enlisting. Something has to be configured to get this working?
I read about every manual i could see, but nowhere i can find some decent information or an example about how to use server bindings.
I've been pulling my hair out for the last 5 days.... |
|
Back to top |
|
 |
David.Partridge |
Posted: Wed Dec 19, 2007 12:15 am Post subject: |
|
|
 Master
Joined: 28 Jun 2001 Posts: 249
|
Are you using an MQBEGIN (or equivalent) to tell the QM that you want to take part in two phase commit? _________________ Cheers,
David C. Partridge |
|
Back to top |
|
 |
TimothyV |
Posted: Wed Dec 19, 2007 12:22 am Post subject: |
|
|
Novice
Joined: 17 Dec 2007 Posts: 17
|
Hi David,
this is the code i'm using:
Code: |
[Transaction(TransactionOption.Required)]
public class CUSTOM_MQ : ServicedComponent
{
public CUSTOM_MQ()
{
}
[AutoComplete]
public void Put()
{
MQMessage mqMsg = null;
MQQueue mqQueue = null;
try
{
MQPutMessageOptions opt = new MQPutMessageOptions();
opt.Options |= IBM.WMQ.MQC.MQPMO_SYNCPOINT;
System.Collections.Hashtable properties = new System.Collections.Hashtable();
properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_BINDINGS);
MQQueueManager _mqQmgr = _mqQmgr = new MQQueueManager("qm_amqtsivt", properties);
mqQueue = _mqQmgr.AccessQueue("TestQueueTimothy", MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT);
mqMsg = new MQMessage();
mqMsg.Format = IBM.WMQ.MQC.MQFMT_STRING;
mqMsg.WriteString(DateTime.Now.ToString("HH:mm:ss"));
mqQueue.Put(mqMsg, opt);
mqQueue.Close();
}
finally
{
if (mqQueue != null && mqQueue.IsOpen)
mqQueue.Close();
}
// throw new Exception("test");
}
} |
i hope this gives you more information... |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 19, 2007 3:48 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
TimothyV wrote: |
Something has to be configured to get this working?
|
Well the queue manager has to be configured to use the same XA transaction coordinator as the database, or be the coordinator for the database. Hence my comment 2 posts ago about checking the configuration and which piece of software is performing the role of coordinator......  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
TimothyV |
Posted: Wed Dec 19, 2007 4:35 am Post subject: |
|
|
Novice
Joined: 17 Dec 2007 Posts: 17
|
MSDTC will be the coordinator. Where must this be configured?
The one screen i think that can be used to configure this is: XA Resource Manager settings.
Queue mngr - properties - resources. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 19, 2007 4:38 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
TimothyV wrote: |
The one screen i think that can be used to configure this is: XA Resource Manager settings.
|
Not a bad place to be configuring XA settings I do agree. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
TimothyV |
Posted: Wed Dec 19, 2007 4:47 am Post subject: |
|
|
Novice
Joined: 17 Dec 2007 Posts: 17
|
lol, i did had a feeling this could be the right place.
Now how must this be configured for MSDTC ?  |
|
Back to top |
|
 |
|