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 » Code going into infinte loop

Post new topic  Reply to topic
 Code going into infinte loop « View previous topic :: View next topic » 
Author Message
satyasheel15
PostPosted: Tue Jun 07, 2005 11:39 pm    Post subject: Code going into infinte loop Reply with quote

Voyager

Joined: 04 Mar 2003
Posts: 86

Hi,

I have written the following code :
----------------------------------------
CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();

-- SETTING THE Header Properties for the Output Message
SET OutputRoot.Properties.MessageDomain = 'MRM';
SET OutputRoot.Properties.MessageSet = 'D26R2C8002001';
SET OutputRoot.Properties.MessageType = 'Document';
SET OutputRoot.Properties.MessageFormat = 'XML1';

DECLARE inRef REFERENCE TO InputRoot.MRM.ns13:itemandprice[>];
DECLARE outRef REFERENCE TO OutputRoot.MRM.ns10:DAF_ARTIKEL[1];

CREATE FIELD OutputRoot.MRM.ns10:DAF_ARTIKEL[1] AS outRef ;

WHILE (LASTMOVE(inRef)= TRUE) DO

-- General rules: Only map elements for which productType in scheme "itemsandprices" that does not have the value ‘4’ (= displays)
IF((inRef.ns13:productType) <> 4) THEN

DECLARE r INTEGER 1;
FOR source5 AS inRef.ns13:artattributes.ns13:artattribute[] DO

DECLARE iAttrClass CHARACTER source5.ns13:attributeClass ;
DECLARE iAttrCode CHARACTER source5.ns13:attributeCode ;

DECLARE vMETRAGE CHARACTER (THE(SELECT ITEM I.METRAGE
FROM Database.METRAGECONV AS I
WHERE I.ATTRIBUTECLASS = iAttrClass AND
I.ATTRIBUTECODE = iAttrCode ));

-- MODIFY:Lookup the value for Metrage in the MetrageConv table
using attributeCode and attributeClass
IF (vMETRAGE IS NOT NULL) THEN SET outRef.ns10:Metrage[r] = vMETRAGE ; END IF;
SET r = r + 1;
END FOR;
END IF;

MOVE outRef NEXTSIBLING REPEAT TYPE NAME;
MOVE inRef NEXTSIBLING REPEAT TYPE NAME;

IF (LASTMOVE(inRef)) THEN
CREATE NEXTSIBLING OF outRef AS outRef REPEAT; END IF;
END WHILE;
---------------------------------------
And the Name of the DATABASE Table is : METRAGECONV and datatype of all the column is CHARACTER. I have also checked the required ODBC connection and set up the Compute NOde properties.

What's happening that whenever I put the test message, when code goes into the code : DECLARE vMETRAGE CHARACTER (THE(SELECT ITEM I.METRAGE
FROM Database.METRAGECONV AS I
WHERE I.ATTRIBUTECLASS = iAttrClass AND
I.ATTRIBUTECODE = iAttrCode ));
as shown above, it goes into INFINITE LOOP.

Can anyone let me know the reason.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
EddieA
PostPosted: Wed Jun 08, 2005 8:17 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Have you tried running a Debug Trace to see if you can spot the problem.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Jun 08, 2005 8:33 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

How do you know where the loop occurs?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Bingo
PostPosted: Sat Jun 11, 2005 3:09 am    Post subject: Hi Reply with quote

Novice

Joined: 31 Mar 2005
Posts: 22

Hi Satyasheel,

Please check if there are 2 rows satisfying your condition in the database for the query which you have written. I think that should sove your problem rather than looking in the code. IF there are 2 idential rows containing same data , then i think the query might fail.

Bye
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 » Code going into infinte loop
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.