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 » Database Cache using shared rows [Solved]

Post new topic  Reply to topic
 Database Cache using shared rows [Solved] « View previous topic :: View next topic » 
Author Message
madi
PostPosted: Mon Oct 02, 2006 8:40 am    Post subject: Database Cache using shared rows [Solved] Reply with quote

Chevalier

Joined: 17 Jan 2006
Posts: 475

Hi All

I am trying to cache a database using shared variables

i declared a shared variable to store information from the database

Code:
DECLARE v_CachedTable SHARED ROW;


I expect the row to be populated when the first message is populated.

but the row variable is being populated for every message i.e. the flow is going to the database for every message essentially invalidating the cache logic

also, when I am debugging the flow and have a breakpoint immediately after the MQInput node, i dont see the v_CachedTable variable anywhere in the pane(where you would see all the variables initialized)

what am I doing wrong

let me know if you need more info

appretiate your thought on this

--madi


Last edited by madi on Mon Oct 02, 2006 12:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Oct 02, 2006 9:52 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

There's a specific example of how to build a database cache using Shared Variables in the Samples Gallery.

Start there.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
madi
PostPosted: Mon Oct 02, 2006 10:19 am    Post subject: Reply with quote

Chevalier

Joined: 17 Jan 2006
Posts: 475

i am following that sample

thats where i got the concept . but looks like im missing something

its just that the database is being cached for every message!!!

do we see the shared variables in the debug pane?? im not able to see anything before we go into the esql

--madi
Back to top
View user's profile Send private message
madi
PostPosted: Mon Oct 02, 2006 10:50 am    Post subject: Reply with quote

Chevalier

Joined: 17 Jan 2006
Posts: 475

how can we differentiate between "Node Shared Variable"(shared between same node in different instances)

and

"Flow shared variables" (shared between same flow for different messages and has the lifetime equal to that of the flow)

i mean how we declare these variables??

--madi
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Oct 02, 2006 11:03 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

With flow-shared variables (that is, those defined at the schema level), take care when multiple flows can update the variables, especially if the variable is being used as a counter. Likewise, with node-shared variables (that is, those defined at the module level), take care when multiple instances can update the variables.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
madi
PostPosted: Mon Oct 02, 2006 11:17 am    Post subject: Reply with quote

Chevalier

Joined: 17 Jan 2006
Posts: 475

i am using ATOMIC to make sure that only one flow or instance of the flow that can access the shared row.

looks like the variable is disappearing right after the message goes through

i am declaring the variable outside of the compute module, so it should be holding data even after the ESQL for that module is done

--madi
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Oct 02, 2006 11:41 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You have to declare SHARED variables in every ESQL file that needs to use those variables.
_________________
I am *not* the model of the modern major general.
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 » Database Cache using shared rows [Solved]
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.