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 » Load-balancing

Post new topic  Reply to topic
 Load-balancing « View previous topic :: View next topic » 
Author Message
K_A
PostPosted: Fri Jan 20, 2006 4:36 am    Post subject: Load-balancing Reply with quote

Apprentice

Joined: 10 Nov 2004
Posts: 32

Hi

We have a solution with a WBIMB broker flow deployed on two machines, load balanced via an MQ-cluster.

For each message received the broker performs a number of database calls (Insert, Update) to a user database (Oracle). This Oracle database resides on a third box and is common to both the broker machines.

Now if both machines process a message at the same time, thus accessing the database exactly at the same time one of them fails, I get strange db-erros about "unique constraint violation" or similar.

If I send all messages to one machine so they are processed in sequence then it's all OK.

My question is: When I issue database calls (Insert, Update) from a database or compute node, what to consider to avoid endine up in situation above?
Back to top
View user's profile Send private message
RichA
PostPosted: Fri Jan 20, 2006 8:50 am    Post subject: Reply with quote

Centurion

Joined: 14 Mar 2002
Posts: 102

The unique constraint error you get would make me think that the data trying to be inserted into the table violates a constraint where one element is supposed to be unique.
I'm not sure this is caused by messages being processed at the same time rather than by the data being processed.
Would you not get the same error if the messages were processed one after the other?

I think when it comes to configurations like this what needs to be taken into account is the database locks, for instance if a row in a database is locked by one process then another process will not be able to update it, I am more familiar with locks on DB2, but googling for database locks should provide you with ample information.
Back to top
View user's profile Send private message MSN Messenger
elvis_gn
PostPosted: Fri Jan 20, 2006 8:26 pm    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi K_A,

Most probably you have some primary key constraints in the table which is being violated by one of the two entries...

I have a scenario in my current project where I dont have a key constraint but two process can be trying to insert into a common table, in such a case i sometimes get a Transaction failed in the flow...

In other words its only understandable that you are having trouble trying multiple inserts/updates at one go....

The solution could be to use database locks..

OR

Use one new common flow to do the insert/update in the table for both your flows.

Regards.
Back to top
View user's profile Send private message Send e-mail
K_A
PostPosted: Mon Jan 23, 2006 6:01 am    Post subject: Reply with quote

Apprentice

Joined: 10 Nov 2004
Posts: 32

The phenomenon does not happen if I run it in one machine, so that the messages are coming after each other. Then it is all OK. That's why I am confused about the "unique constraint".

I will try data lock and see what's happening.

Regards
K_A
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Tue Jan 24, 2006 1:29 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi K_A,

You will have to expain the logic of the flow to us...Tell us about the Primary and foreign keys in the table...if any.

Also, if you are doing exception handling then show us the entire Exception tree..

Regards.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Load-balancing
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.