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 » Multiple Database Inserts in the same Compute Node

Post new topic  Reply to topic
 Multiple Database Inserts in the same Compute Node « View previous topic :: View next topic » 
Author Message
Sam99
PostPosted: Thu May 16, 2013 9:26 am    Post subject: Multiple Database Inserts in the same Compute Node Reply with quote

Apprentice

Joined: 19 Jul 2012
Posts: 43

Hello All,

I've a repeating element in my XML, each repeating element must be inserted as a new row in the database.

Volume : 1000 messages

We are using Stored Procedure to insert the data in SQL server

Is it a good idea to do this in a sinlge compute node ?
Is there any better way to achieve this in a performant way ?

Many Thanks
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu May 16, 2013 9:57 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

>> Is it a good idea to do this in a sinlge compute node ?

Yes.

>> Is there any better way to achieve this in a performant way ?

Compute/Database node is the most efficient.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
new2z
PostPosted: Fri May 17, 2013 12:54 pm    Post subject: Reply with quote

Novice

Joined: 16 May 2013
Posts: 15

@Sam99

You should do it in one Compute Node


For better performance, what you may want to do is
1. Make the stored procedure call only once. Let the stored procedure loop through your data and insert it in to new rows. use the transaction container of your RDBMS for these inserts.

Do not make connection to the database everytime you want to insert a new row, esp when you are speaking about 1000 rows at one go within matter of seconds. That means, 1 thread will end up making 1000 connections within secs.

Better to have only 1 touchpoint with the DB, and pas all that is required by the DB to a stored proc and let the stored proc do the looping. It will be faster that way.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue May 21, 2013 5:47 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

new2z wrote:
Do not make connection to the database everytime you want to insert a new row, esp when you are speaking about 1000 rows at one go within matter of seconds. That means, 1 thread will end up making 1000 connections within secs.


That's not the way Broker ODBC works.
Back to top
View user's profile Send private message
kash3338
PostPosted: Wed May 22, 2013 1:45 am    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

mqjeff wrote:
new2z wrote:
Do not make connection to the database everytime you want to insert a new row, esp when you are speaking about 1000 rows at one go within matter of seconds. That means, 1 thread will end up making 1000 connections within secs.


That's not the way Broker ODBC works.




This is what the Infocenter says about ODBC Connections,

Quote:

The number of connections to a user database that a broker requires depends on the actions of the message flows that access the database. For each message flow thread, a broker that accesses a user database makes one connection for each data source name (DSN). If a different node on the same thread uses the same DSN, the same connection is used, unless a different transaction mode is used, in which case another connection is required.
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 » Multiple Database Inserts in the same Compute Node
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.