Author |
Message
|
Bartez75 |
Posted: Wed Apr 15, 2009 3:04 am Post subject: SHARED ROW or Environment variable? |
|
|
 Voyager
Joined: 26 Oct 2006 Posts: 80 Location: Poland, Wroclaw
|
Hi,
I want to store xmls somewhere to use it later in the flow. What is better from performance and memory consumption point of view?
SHARED ROW variable or Environment variable?
Broker 6.0 |
|
Back to top |
|
 |
vandi |
Posted: Wed Apr 15, 2009 7:32 am Post subject: Re: SHARED ROW or Environment variable? |
|
|
Acolyte
Joined: 13 Dec 2008 Posts: 67
|
Bartez75 wrote: |
Hi,
I want to store xmls somewhere to use it later in the flow. What is better from performance and memory consumption point of view?
SHARED ROW variable or Environment variable?
Broker 6.0 |
Environment Variables can be used to hold the value throughout the flow for a single message.
When we come to SHARED Variables , they have a long lifetime and are visible to multiple messages passing through a flow.
According to me, If you want to store the value only for a single message you can proceed with Environment variable.
Thanks |
|
Back to top |
|
 |
Bartez75 |
Posted: Wed Apr 15, 2009 8:42 am Post subject: |
|
|
 Voyager
Joined: 26 Oct 2006 Posts: 80 Location: Poland, Wroclaw
|
I'm trying ROW without SHARED, declared in the module. It works in debug but without debug it gives error with mini dump.
Error from Event Viewer:
A summary of the Error follows:
An Unhandled Exception detected in process 2436, on thread 0x7F4.
Type: EXCEPTION_ACCESS_VIOLATION (C0000005).
Address: 001B:7C342EEE.
The thread could not read from memory address 0x129A018C.
'.
A broker process is terminating abnormally.
In the ROW variable I store several xml messages taken from queue by MQGET node. Then in a loop I create OutputRoot with values from that ROW variable.
Then, I'm calling propagate in the loop after I create correct OutputRoot.
I'm calling CopyMessageHeaders() in the right place.
If I replace ROW variable with Environment.Variables then it works but I would like not to use Environment.Variables to store this xml messages because of memory usage.
The design is that I can't delete Environment.Variables before propagate so it will go with message to next nodes.
I can delete it later but I thought that ROW will solve it.
So, I just need to store let say 10 xml msg somewhere (in some variable) and then us it to create several OutputRoot.
What are my options here? To be honest I never had to use ROW before so I don't have experience with it. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Wed Apr 15, 2009 9:11 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
Bartez75 wrote: |
Error from Event Viewer:
A summary of the Error follows:
An Unhandled Exception detected in process 2436, on thread 0x7F4.
Type: EXCEPTION_ACCESS_VIOLATION (C0000005).
Address: 001B:7C342EEE.
The thread could not read from memory address 0x129A018C.
'.
A broker process is terminating abnormally.
|
I'd raise a PMR for that.
Quote: |
If I replace ROW variable with Environment.Variables then it works but I would like not to use Environment.Variables to store this xml messages because of memory usage.
|
Whats the difference in terms of memory usage?
Quote: |
The design is that I can't delete Environment.Variables before propagate so it will go with message to next nodes.
|
Why not? Why dont you just delete the variable you no longer need once its not needed?
I'm not sure I understand the constraints if you could explain I may be able to help more. |
|
Back to top |
|
 |
Bartez75 |
Posted: Thu Apr 16, 2009 1:59 am Post subject: |
|
|
 Voyager
Joined: 26 Oct 2006 Posts: 80 Location: Poland, Wroclaw
|
Hi,
This error I have on my local machine. When I run it on company server it works so I must have something on my pc or maybe lack of memory or perhaps no valid fixes installed.
Anyway, it is working with ROW but I have some basic question, I think.
Let say I have (pseudo code):
Code: |
DECLARE XmlMsgTable ROW;
i=1
loop
SET XmlMsgTable.Xml[i] = Environment.Variables.MsgFromMQGet.XML; -- I got this message in the same loop (there is a propagate to MQGET node and this Environment.Variable.MsgFromMQGet is set there with the xml message which is on the queue)
i++;
end of loop
|
Then I use XmlMsgTable.Xml to build OutputRoot.
Do I have to delete this ROW variable at the end of compute node module to free memory, like:
SET XmlMsgTable.Xml = null;
or
SET XmlMsgTable = null;
or this is done by the broker itself? |
|
Back to top |
|
 |
mgk |
Posted: Thu Apr 16, 2009 2:30 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
From looking at your code above, I don't see why you need to use a ROW at all, can't you just build up your message in OutputRoot directly?
Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
Bartez75 |
Posted: Thu Apr 16, 2009 2:52 am Post subject: |
|
|
 Voyager
Joined: 26 Oct 2006 Posts: 80 Location: Poland, Wroclaw
|
It is just a part of the code.
The design is that I get one message (Msg1) on queue1. That xml message has elements MsgId with values of MQ MessageId of messages from queue2 (Msg2). So Msg1 has MQ MessageId of all related messages that are on queue2. Msg1 has also some other information, not just MsgId.
And in the loop I'm first gettting all messages (Msg2) from queue2 by propagating message with MQMD.MsgId = Msg1.MsgId to MQGET.
And I store these messages from queue2 in ROW.
And when I have them all in ROW I can create OutputRoot.
I'm stroing this in ROW or Environment because I have to create several OutputRoot based on messages from queue2 and when MQGET node do get messages are deleted from queue.
Can I browse messages with MQGET node (broker 6.0)?
Anyway I'm wondering if assigning null to that ROW variable makes any sense if it is at the end of module. I think that broker will destroy that variable, am I right? |
|
Back to top |
|
 |
Bartez75 |
Posted: Thu Apr 30, 2009 7:02 am Post subject: |
|
|
 Voyager
Joined: 26 Oct 2006 Posts: 80 Location: Poland, Wroclaw
|
Hi
Again me just before the long weekend.
I think I have a simple question but I don't know the answer.
Let say that there is variable Environment.Variables.Test
This variable contains a tree (xml message)
After SET Environment.Variables.Test = NULL element Test is deleted but what is happening in memory? Is it released after this?
Thanks for any help with this and have a nice weekend. |
|
Back to top |
|
 |
|