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 » WebSphere Message Broker (ACE) Support » Question on uncommitted insert using message flow

Post new topic  Reply to topic
 Question on uncommitted insert using message flow « View previous topic :: View next topic » 
Author Message
geethgubi
PostPosted: Tue Feb 17, 2009 1:35 pm    Post subject: Question on uncommitted insert using message flow Reply with quote

Apprentice

Joined: 18 Dec 2008
Posts: 44

I have a scenario in the message broker where I am getting the xml message in one of my flows and I will take the data from that xml and insert it into the database. There are chances that I can get multiple messages at a time. Currently I am getting 2 messages (This is actually bug) one of them is a original message generated and the other one is a duplicate message. So if you see the data, the data remains the same for both the messages. And hence while inserting the data into the database I am getting an error which says root sql exception. some of my collegues are telling tha t this is due to the uncommit lock issue. So can somebody help me out with what will happen when I send the same data twice and keep my Transaction property of compute node as 'Automatic'?

Thanks.
Back to top
View user's profile Send private message
MQEnthu
PostPosted: Tue Feb 17, 2009 10:16 pm    Post subject: Reply with quote

Partisan

Joined: 06 Oct 2008
Posts: 329
Location: India

If you set transaction property of the compute node to Automatic, the database transactions will depend on the success or failure of the entire message flow.

If you are trying to insert duplicate data into database, there will be sql error. And by default the flow throws exception for databse errors (unless you have cleared the check box 'throw exception on database errors'). You will have to handle the exception in the messageflow.
_________________
-----------------------------------------------
It is good to remember the past,
but don't let past capture your future
Back to top
View user's profile Send private message
vandi
PostPosted: Wed Feb 18, 2009 7:09 am    Post subject: Reply with quote

Acolyte

Joined: 13 Dec 2008
Posts: 67

Hi,
As you told you are getting two messages, try to keep flag on the original message, so that it would prevent duplicate insertions.


Thanks
vandi
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Feb 18, 2009 7:40 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

vandi wrote:
Hi,
As you told you are getting two messages, try to keep flag on the original message, so that it would prevent duplicate insertions.


Thanks
vandi


No, this is bad. This is message affinity. Do not design this.
Back to top
View user's profile Send private message
vandi
PostPosted: Wed Feb 18, 2009 7:48 am    Post subject: Reply with quote

Acolyte

Joined: 13 Dec 2008
Posts: 67

mqjeff,

I am focussiong on a way to distinguish the original message with the message being inserted to DB.


Thanks
Vandi
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Feb 18, 2009 7:51 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

MQEnthu answered that. The database will throw an error when you try to insert duplicate data or data into a row with a duplicate key.

That's how you tell.

Anything else is the wrong approach.
Back to top
View user's profile Send private message
vandi
PostPosted: Wed Feb 18, 2009 7:58 am    Post subject: Reply with quote

Acolyte

Joined: 13 Dec 2008
Posts: 67

mqjeff,

Thanks for your suggestion. Will make sure to answer to the point.


Thanks
vandi
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 » WebSphere Message Broker (ACE) Support » Question on uncommitted insert using message flow
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.