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 » Question about MQ Transactions and .NET

Post new topic  Reply to topic
 Question about MQ Transactions and .NET « View previous topic :: View next topic » 
Author Message
wfudeac92
PostPosted: Tue May 16, 2006 1:32 pm    Post subject: Question about MQ Transactions and .NET Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue May 16, 2006 1:45 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
wfudeac92
PostPosted: Tue May 16, 2006 1:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
mvic
PostPosted: Tue May 16, 2006 2:09 pm    Post subject: Re: Question about MQ Transactions and .NET Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

wfudeac92 wrote:
Does closing the queue have an implied commit, if you are using MQGMO_SYNCPOINT as the get option?

No. But explicitly disconnecting implies a commit.

Actually the rules are subtly different on various platforms. Read the whole section at http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzal.doc/usesync.htm if you need/want to know all about this.
Back to top
View user's profile Send private message
wfudeac92
PostPosted: Tue May 16, 2006 4:22 pm    Post subject: Reply with quote

Novice

Joined: 24 Apr 2006
Posts: 21

Thanks!!!!! That is what I needed.
Back to top
View user's profile Send private message
Leigh Kendall
PostPosted: Tue May 23, 2006 3:44 am    Post subject: Reply with quote

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
View user's profile Send private message
dpchiesa
PostPosted: Thu May 25, 2006 8:24 pm    Post subject: .NET and transactions Reply with quote

Apprentice

Joined: 29 May 2002
Posts: 46

Quote:
Since you're using .NET, I would highly recommend using Serviced Components (COM+) for your transaction management.


ServicedComponents works, but of course, you can also use Services without Components (SwC) in .NET 1.1, or System.Transactions in .NET 2.0.

whitepaper on Sys.Tx:
http://www.microsoft.com/downloads/details.aspx?familyid=11632373-BC4E-4C14-AF25-0F32AE3C73A0&displaylang=en

article on SwC and Sys.Tx:
http://blogs.msdn.com/dotnetinterop/archive/2005/12/01/499090.aspx
_________________
-dpchiesa
Back to top
View user's profile Send private message
Leigh Kendall
PostPosted: Fri May 26, 2006 6:38 am    Post subject: Reply with quote

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
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 » Question about MQ Transactions and .NET
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.