Author |
Message
|
wfudeac92 |
Posted: Tue May 16, 2006 1:32 pm Post subject: Question about MQ Transactions and .NET |
|
|
Novice
Joined: 24 Apr 2006 Posts: 21
|
I am writing a .NET program that reads a message off of the queue and does some processing with the message. If the process fails I do a MQQueueManager.Backout to roll the transaction back. Likewise, if the process is successfull, I do a MQQueueManger.Commit. Here are the getoptions that I am using.
MQC.MQGMO_WAIT | MQC.MQGMO_SYNCPOINT | MQC.MQGMO_ACCEPT_TRUNCATED_MSG | MQC.MQGMO_CONVERT
While debugging I noticed that if I just read a message off of the queue, close the queue and disconnect from the queue manager, the message that I read is gone. Basically, I skip over doing a commit and/or backout. Does closing the queue have an implied commit, if you are using MQGMO_SYNCPOINT as the get option? |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue May 16, 2006 1:45 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Yes there are default behaviors and they may change depending on language and platform.
I have found it is ALWAYS prudent to make an explicit commit or rollback.
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
wfudeac92 |
Posted: Tue May 16, 2006 1:48 pm Post subject: |
|
|
Novice
Joined: 24 Apr 2006 Posts: 21
|
I agree with you. I was just curious as to whether or not there was an implied commit. Seems like it would be the opposite. |
|
Back to top |
|
 |
mvic |
Posted: Tue May 16, 2006 2:09 pm Post subject: Re: Question about MQ Transactions and .NET |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
|
Back to top |
|
 |
wfudeac92 |
Posted: Tue May 16, 2006 4:22 pm Post subject: |
|
|
Novice
Joined: 24 Apr 2006 Posts: 21
|
Thanks!!!!! That is what I needed.  |
|
Back to top |
|
 |
Leigh Kendall |
Posted: Tue May 23, 2006 3:44 am Post subject: |
|
|
 Acolyte
Joined: 10 Apr 2003 Posts: 66 Location: Hartford, CT
|
wfudeac92 -
Since you're using .NET, I would highly recommend using Serviced Components (COM+) for your transaction management. This will easily allow you to bring in other resources into your transaction(s) if you need such as a database.
For more info, check out the Redbook entitled:
"WebSphere MQ Solutions in a Microsoft .NET Environment"
http://publib-b.boulder.ibm.com/abstracts/sg247012.html?Open
HTH, _________________ Leigh Kendall |
|
Back to top |
|
 |
dpchiesa |
Posted: Thu May 25, 2006 8:24 pm Post subject: .NET and transactions |
|
|
 Apprentice
Joined: 29 May 2002 Posts: 46
|
|
Back to top |
|
 |
Leigh Kendall |
Posted: Fri May 26, 2006 6:38 am Post subject: |
|
|
 Acolyte
Joined: 10 Apr 2003 Posts: 66 Location: Hartford, CT
|
dpchiesa -
Unfortunately, I "have" to use .NET 1.1 which is why I neglected to mention System.Transactions, but you're absolutely right; if you're using .NET 2.0 you would be better off using the System.Transaction namespace. Great links by the way... love your blog , and Juval Lowy (whitepaper link) is another expert resource in this area.
I know Oracle (which I'm using) can't participate in LTM transactions in System.Transactions, but they may in the future of course. How about IBM MQ? Do they support the LTM? I guess either way when using .NET 2.0 definitely go with System.Transactions...
Thanks for bringing this up!... _________________ Leigh Kendall |
|
Back to top |
|
 |
|