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 » Use of Shared variables

Post new topic  Reply to topic
 Use of Shared variables « View previous topic :: View next topic » 
Author Message
kash3338
PostPosted: Wed Dec 08, 2010 10:56 pm    Post subject: Use of Shared variables Reply with quote

Shaman

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

Hi, We have a scenario in our project where we have to fetch few values from Database.

We came across a suggestion to use Shared Row to load the values from the Database initially when the flow runs and later fetch the values from the Shared Row. One of the drawback that we found in this usage is that, we have to reload the execution group every time we insert/delete/update he database.

Can anyone suggest the better approach in terms of effenciency, can we use a select query directly or can we have a shared row to fetch the values from DB at once?

The number of rows to be fetched from the database is at max 25.
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Wed Dec 08, 2010 11:56 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Think about the following

1) Add a timenode to do periodic DB reads & Shared Row refreshes.
2) An an MQ Input Node to do the above. Send any message to the flow to get the DB vaues refreshed. Thus using WMQ as a trigger.

We use 1) above on a 24 hour clock.
The refresh cycle really depends upon how often the vaues in the DB will change.
On another project, we used a 30sec refresh time because that was the agreed SLA
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Herbert
PostPosted: Thu Dec 09, 2010 12:51 am    Post subject: Re: Use of Shared variables Reply with quote

Centurion

Joined: 05 Dec 2006
Posts: 146
Location: Leersum, The Netherlands

kash3338 wrote:
We came across a suggestion to use Shared Row to load the values from the Database initially when the flow runs and later fetch the values from the Shared Row. One of the drawback that we found in this usage is that, we have to reload the execution group every time we insert/delete/update he database.

Can anyone suggest the better approach in terms of effenciency, can we use a select query directly or can we have a shared row to fetch the values from DB at once?

A option is to add a second input node to the flow to reset the shared row(s), I use the HTTPInput node for this. That way after updating the database you can execute a URL in your browser and the shared row is reloaded from the database.

hgj
Back to top
View user's profile Send private message Visit poster's website
zpat
PostPosted: Thu Dec 09, 2010 12:55 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Why not store the date/time of the data load in a shared variable as well?

Each time you access the shared variable data, check this value and if it beyond a certain age limit, reload the data from the db.

This way it is automatic and does not require any intervention.

This age limit could be stored as an external property of the flow.
Back to top
View user's profile Send private message
kash3338
PostPosted: Thu Dec 09, 2010 1:16 am    Post subject: Reply with quote

Shaman

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

Thanks for the options. I will try applying one of this.

My doubt is, is using the Shared Row a better choice or can we directly query the Database everytme? The amount of data that we have is not so large though.
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Thu Dec 09, 2010 2:44 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

There are lots of factors that will influence your decision.

Most of them relate to performance. A few of them are:-

1) How many instances of the flow are there?
2) What is the message rate?
3) What is the probability of DB row locking causing prodlems
4) Is the DB being accessed local or remote?
5) Is your DB read coded to be the READ ONLY
etc etc etc

Only you will know the answers to these.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Dec 09, 2010 3:17 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The more important factor is "how often will the data change"? If the data changes frequently, then it's better to use a direct lookup.

if the data only changes once a day or once a week or etc. then use some kind of caching - shared row for example.
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 » Use of Shared variables
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.