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 » IB 9003: Broker lost fields after SELECT in FOR cycle

Post new topic  Reply to topic
 IB 9003: Broker lost fields after SELECT in FOR cycle « View previous topic :: View next topic » 
Author Message
Jenum
PostPosted: Mon Aug 31, 2015 5:46 am    Post subject: IB 9003: Broker lost fields after SELECT in FOR cycle Reply with quote

Novice

Joined: 13 Nov 2012
Posts: 24

Good day everyone!
Does anybody deal with such error on Integration Bus 9 (9003)?

It can be repeated as follows:

simple msgflow: MQInput -> Compute Node -> MQOutput;

In Compute Node:

Code:
CREATE COMPUTE MODULE Srv1_Compute
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN
      CALL CopyMessageHeaders();
      
      DECLARE input REFERENCE TO InputRoot.XMLNSC.root;
      DECLARE output REFERENCE TO OutputRoot;
      
      CREATE FIELD OutputRoot.XMLNSC.root AS output;
      
      DECLARE outFirst REFERENCE TO output;
      DECLARE help REFERENCE TO outFirst;
      
      FOR first AS input.a1[] DO
         CREATE LASTCHILD OF output AS outFirst NAME 'Element';
         SET outFirst.(XMLNSC.Attribute)id = first.id;
         
         FOR sec AS input.b2[] DO
            IF sec.id = first.id THEN
               FOR el AS sec.element[] DO
                  CREATE LASTCHILD OF outFirst AS help NAME 'b2' VALUE el.name;
               END FOR;
            END IF;
         END FOR;
         
         FOR sec AS input.b1[] DO
            IF sec.id = first.id THEN
               FOR el AS sec.element[] DO
                  CREATE LASTCHILD OF outFirst AS help NAME 'b1' VALUE el.name;
               END FOR;
            END IF;
         END FOR;
         
         /* Losing fields after this */
         DECLARE elements ROW THE(
            SELECT * FROM input.c1[] AS C WHERE C.id = first.id
         );
         
         FOR el AS elements.element[] DO
            CREATE LASTCHILD OF outFirst AS help NAME 'c1' VALUE el.name;
         END FOR;
      END FOR;
      
      PROPAGATE TO TERMINAL 0 MESSAGE InputRoot DELETE NONE;
      
      RETURN TRUE;
   END;

   CREATE PROCEDURE CopyMessageHeaders() BEGIN
      DECLARE I INTEGER 1;
      DECLARE J INTEGER;
      SET J = CARDINALITY(InputRoot.*[]);
      WHILE I < J DO
         SET OutputRoot.*[I] = InputRoot.*[I];
         SET I = I + 1;
      END WHILE;
   END;
END MODULE;


I put such XML:

Code:
<root>
   <a1 id="1"/>
   <a1 id="2"/>
   <a1 id="3"/>
   <a1 id="4"/>
   <a1 id="5"/>
   <b2 id="1">
      <element name="1_1"/>
   </b2>
   <b2 id="2">
      <element name="2_1"/>
   </b2>
   <b2 id="3">
      <element name="3_1"/>
   </b2>
   <b2 id="4">
      <element name="4_1"/>
   </b2>
   <b2 id="5">
      <element name="5_1"/>
   </b2>
   <b1 id="1">
      <element name="1_1"/>
   </b1>
   <b1 id="2">
      <element name="2_1"/>
   </b1>
   <b1 id="3">
      <element name="3_1"/>
   </b1>
   <b1 id="4">
      <element name="4_1"/>
   </b1>
   <b1 id="5">
      <element name="5_1"/>
   </b1>
   <c1 id="1">
      <element name="1_1"/>
   </c1>
   <c1 id="2">
      <element name="2_1"/>
   </c1>
   <c1 id="3">
      <element name="3_1"/>
   </c1>
   <c1 id="4">
      <element name="4_1"/>
   </c1>
   <c1 id="5">
      <element name="5_1"/>
   </c1>
</root>


And get following messages:


Code:
InputRoot:
<root>
 <a1 id="1"/>
 <a1 id="2"/>
 <a1 id="3"/>
 <a1 id="4"/>
 <a1 id="5"/>
 <b2 id="1">
  <element name="1_1"/>
 </b2>
 <b2 id="2">
  <element name="2_1"/>
 </b2>
 <b2 id="3">
  <element name="3_1"/>
 </b2>
 <b2 id="4">
  <element name="4_1"/>
 </b2>
 <b2 id="5">
  <element name="5_1"/>
 </b2>
 <b1 id="1">
  <element name="1_1"/>
 </b1>
 <c1 id="1">
  <element name="1_1"/>
 </c1>
 <c1 id="2">
  <element name="2_1"/>
 </c1>
 <c1 id="3">
  <element name="3_1"/>
 </c1>
 <c1 id="4">
  <element name="4_1"/>
 </c1>
 <c1 id="5">
  <element name="5_1"/>
 </c1>
</root>


Code:
OutputRoot:
<root>
 <Element id="1">
  <b2>1_1</b2>
  <b1>1_1</b1>
  <c1>1_1</c1>
 </Element>
 <Element id="2">
  <b2>2_1</b2>
  <b1>2_1</b1>
  <c1>2_1</c1>
 </Element>
 <Element id="3">
  <b2>3_1</b2>
  <b1>3_1</b1>
  <c1>3_1</c1>
 </Element>
 <Element id="4">
  <b2>4_1</b2>
  <c1>4_1</c1>
 </Element>
 <Element id="5">
  <b2>5_1</b2>
  <c1>5_1</c1>
 </Element>
</root>


So, it seems that broker begins to lose last b1-tag after SELECT-statement on each cycle repetition.

If i will be work with c1-tag like b1 and b2, it is all OK.


Last edited by Jenum on Mon Aug 31, 2015 5:49 am; edited 1 time in total
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Aug 31, 2015 5:49 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

And does
Code:
SET outFirst.(XMLNSC.Attribute)id = first.id;
work?
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
Jenum
PostPosted: Mon Aug 31, 2015 5:57 am    Post subject: Reply with quote

Novice

Joined: 13 Nov 2012
Posts: 24

mqjeff, yes, of course.

Remark: it isn't production code, only for test
Back to top
View user's profile Send private message
Jenum
PostPosted: Mon Aug 31, 2015 7:00 am    Post subject: Reply with quote

Novice

Joined: 13 Nov 2012
Posts: 24

One notice: if i declare variable elements before main cycle, it is all OK.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Aug 31, 2015 7:06 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

So. When you identify the attribute as an XMLNSC.Atrtibute, you're able to retrieve the value.

But you aren't identifying it as an XMLNSC.Attribute when you are trying to compare the value.
_________________
chmod -R ugo-wx /
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 » IB 9003: Broker lost fields after SELECT in FOR cycle
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.