|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
[Solved] Default values overwriting SET statements... |
« View previous topic :: View next topic » |
Author |
Message
|
lung |
Posted: Sun Dec 08, 2002 5:01 pm Post subject: [Solved] Default values overwriting SET statements... |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
Hi all,
I have encountered a weird problem with WMQI here... Let's just say I have Field1, Field2, and Field3 (ordered this way in the MRM), all with default values of 'ABC'. And I have the following code...
Code: |
SET OutputRoot.MRM.Field1 = 'DEF';
SET OutputRoot.MRM.Field3 = 'DEF';
SET OutputRoot.MRM.Field2 = 'DEF';
|
Notice that I set field2 after field3... The resulting MRM? Field1 and Field3 will be 'DEF' but field2 will be 'ABC'.
However, if...
Code: |
SET OutputRoot.MRM.Field1 = 'DEF';
SET OutputRoot.MRM.Field2 = 'DEF';
SET OutputRoot.MRM.Field3 = 'DEF';
|
Notice that I set everything in order in accordance to the MRM... The resulting MRM? All fields will have 'DEF'.
What gives? I thought we can issue SET statements anywhere in our codes regardless of the order of the fields in the MRM... _________________ lung |
|
Back to top |
|
 |
kirani |
Posted: Sun Dec 08, 2002 6:25 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Lung,
This is because of the value set for Type Composition property for the main/parent compound type in your MessageSet, I bet it's set to Ordered Set (default value) in your case. In first case, since you are not setting these fields in the order in which they are defined into Message Set, second field Field2 contains NULL value while writing out the BITSTREAM, this explain why the DEFAULT value is assigned to this field by MRM-Writer.
If you want to write SET statements out-of-order then set your Type Composition to Unordered Set and then you can write your ESQL statements in any order to assign values to MRM-Elements. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
lung |
Posted: Mon Dec 09, 2002 4:41 pm Post subject: |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
Thanks, Kiran.
If that's the case, then I think I should just set all my compound types to 'Unordered Set'. But is this safe? Can you give me an example where I would use 'Ordered Set'? Frankly speaking, I don't see any applicatoin of 'Ordered Set'...  _________________ lung |
|
Back to top |
|
 |
lung |
Posted: Mon Dec 09, 2002 5:19 pm Post subject: |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
Come to think of it... If I set to 'Unordered Set', will my output msg still comes out in order? (field1,field2,field3) Or will it come out in this order? -> field1,field3,field2 ?
This is an MRM-CWF message and not an XML message, so I can't afford to have random order of the fields...  _________________ lung |
|
Back to top |
|
 |
kirani |
Posted: Mon Dec 09, 2002 6:54 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Hi Lung,
Yes, it is safe to use Unordered Set in your message sets!! Yes, your output will be in order when you use Unorder Set compound types.
I think you will get better performance with Ordered Set as compared with Unordered Set compound types. For Unordered Set compound types, MRM Writer will try it's best to re-order the Message Tree when writing out the message so that the order matches with the message definition. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
lung |
Posted: Tue Dec 10, 2002 4:40 pm Post subject: |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
Thanks, Kiran! I've tried with 'Unordered Set' and looks like everything is going smoothly and I've yet to see any decline in performance You're a lifesaver!
By the way... How did you put that [Solved] thingy in the message title? _________________ lung |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|