Author |
Message
|
madi |
Posted: Mon Oct 02, 2006 8:40 am Post subject: Database Cache using shared rows [Solved] |
|
|
 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 |
|
 |
jefflowrey |
Posted: Mon Oct 02, 2006 9:52 am Post subject: |
|
|
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 |
|
 |
madi |
Posted: Mon Oct 02, 2006 10:19 am Post subject: |
|
|
 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 |
|
 |
madi |
Posted: Mon Oct 02, 2006 10:50 am Post subject: |
|
|
 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 |
|
 |
jefflowrey |
Posted: Mon Oct 02, 2006 11:03 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
madi |
Posted: Mon Oct 02, 2006 11:17 am Post subject: |
|
|
 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 |
|
 |
jefflowrey |
Posted: Mon Oct 02, 2006 11:41 am Post subject: |
|
|
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 |
|
 |
|