|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Resolved: Declare Shared Row Question |
« View previous topic :: View next topic » |
Author |
Message
|
wraymore |
Posted: Mon Mar 24, 2008 8:21 am Post subject: Resolved: Declare Shared Row Question |
|
|
Centurion
Joined: 16 Aug 2005 Posts: 114 Location: Burlington, NC USA
|
WMB 6.0.0.5
WBMT 6.0.2
We are using the Declare Name Shared Row to cache routing data in 2 execution groups (These have the same Name - CacheQueueTableDev). -- Working fine!!!
However we would like to use the Declare Name Shared Row in another execution group that uses different data base tables to construct the cache (CacheVendorTableDev). When attempting to deploy the bar file to this execution group, I receive deployment error stating that my new Name is not in scope.
Is it possible to have separate Shared Rows Declared?
Last edited by wraymore on Wed Mar 26, 2008 1:00 pm; edited 1 time in total |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Mar 24, 2008 8:25 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Yes, it's possible to declare more than one shared variable.
Yes, it's possible to share more than one variable in the same node/etc.
No, it's not possible to share row variables between execution groups using ESQL. ESQL only lets you share stuff within an EG, at either the flow or the node level.
It's not clear how you're trying to do what you're trying to do. So it's not clear what the problem is. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
wraymore |
Posted: Mon Mar 24, 2008 1:09 pm Post subject: |
|
|
Centurion
Joined: 16 Aug 2005 Posts: 114 Location: Burlington, NC USA
|
More specifics about my problem:
ESQL Snippet:
declare CacheVendorTableDev SHARED ROW; -- shared variable for database caching
...
CREATE COMPUTE MODULE TRD_EnterpriseFaxManagerReports_DetermineFaxVendorOrder
CREATE FUNCTION Main() RETURNS BOOLEAN BEGIN
/*
Author: Weldon Moore
Updated: 3/20/2008
PROGRAM NOTES:
This program extracts the Fax Vendor and Connection Information based up on a
random number and Load Balance Percentages.
VERSION NOTES:
Version 1
- Vendor Connection Information is is stored in DB2, this information is cached at
the execution group level to minimize database access and to improve performance.
*/
CALL CopyEntireMessage();
SET OutputLocalEnvironment = InputLocalEnvironment;
DECLARE triadMsgNS NAMESPACE 'http://www.labcorp.com/02/11/2008/V1/TriadMessage.xsd';
DECLARE triadNS NAMESPACE 'http://www.labcorp.com/02/11/2008/V1/TriadCommon.xsd';
DECLARE TriadFaxOption REFERENCE TO OutputRoot.XMLNSC.triadMsgNS:TriadMessage.triadMsgNS:TriadDestinationInfo.triadNS:DeliveryOptions.triadNS:FaxOptions;
DECLARE ERRFlag CHARACTER;
DECLARE ErrorMessage CHARACTER;
DECLARE SQLState1 CHARACTER;
DECLARE SQLErrorText1 CHARACTER;
DECLARE RandomString CHARACTER;
DECLARE SQLCode1 INTEGER;
DECLARE I INTEGER;
DECLARE FXV_Found INTEGER;
DECLARE RandomInteger INTEGER;
DECLARE RandomNbr FLOAT;
VENDORSELECT : BEGIN ATOMIC -- atomic block restricts the processing to be single threaded for setting the cache
IF CacheVendorTableDev.valid IS NULL THEN
SET CacheVendorTableDev.VendorData[] =
(
SELECT A.SERVICE_SRCE_CD, B.HIGH_VALUE_NUM, B.LOW_VALUE_NUM, C.CONNECTION_NM, C.URL_TXT, C.PROTOCOL_NM,
C.PORT_NUM, C.PATH_TXT, C.USERID, C.USER_PASSWORD, C.SSL_IND, C.RETRY_CNT, C.PRIORITY_SEQ_NUM
FROM Database.EBADEV.EBA010_SERV_SOURCE as A, Database.EBADEV.EBA015_VENDOR as B,
Database.EBADEV.EBA006_CONNECTION as C
WHERE A.SERVICE_SRCE_CD = B.FK_SERVICE_SRCE_CD AND
A.SERVICE_SRCE_CD = C.FK_SERVICE_SRCE_CD AND
B.ACTIVE_IND = 'Y' AND
C.CONNECTION_ID = D.FK_CONNECTION_ID
);
SET CacheVendorTableDev.valid = true;
END IF;
END VENDORSELECT ; -- end of ROUTING atomic block
...
SET Environment.PrimaryVendor[] =
(
SELECT S.SERVICE_SRCE_CD, S.CONNECTION_NM, S.URL_TXT, S.PROTOCOL_NM, S.PORT_NUM,
S.PATH_TXT, S.USERID, S.USER_PASSWORD,S.SSL_IND, S.RETRY_CNT
FROM CacheVendorTableDev.VendorData[] as S
WHERE S.LOW_VALUE_NUM <= RandomInteger AND
S.HIGH_VALUE_NUM >= RandomInteger AND
S.PRIORITY_SEQ_NUM = TriadFaxOption.TriadNS:Priority
);
Error receiving when deploying Message Flow to EG TRIAD_FAX.
BIP2432E: (.TRD_EnterpriseFaxManagerReports_DetermineFaxVendorOrder.Main, 32.7) : The correlation name 'CacheVendorTableDev.valid' is not valid. Those in scope are: CacheQueueTableDev, Environment, InputLocalEnvironment, OutputLocalEnvironment, InputRoot, InputBody, InputProperties, OutputRoot, InputExceptionList, OutputExceptionList, InputDestinationList, OutputDestinationList, triadMsgNS, triadNS, TriadFaxOption, ERRFlag, ErrorMessage, SQLState1, SQLErrorText1, RandomString, SQLCode1, I, FXV_Found, RandomInteger, RandomNbr.
The first element of a field reference must be a valid correlation name, from those in scope. This message may sometimes be due to an incorrectly formed or spelled expression which is not intended to be a field reference being parsed as if it were a field reference because the parser does not recognize it.
Correct the syntax of your ESQL expression in node '.TRD_EnterpriseFaxManagerReports_DetermineFaxVendorOrder.Main', around line and column '32.7', then redeploy the message flow.
We have two other execution groups that have flows that incorporate a subflow that has the declare Name Shared Row statement:
declare CacheQueueTableDev SHARED ROW; -- shared variable for database caching
CREATE COMPUTE MODULE TRD_XML_Determine_Routing_Dev
CREATE FUNCTION Main() RETURNS BOOLEAN BEGIN
CALL CopyEntireMessage();
DECLARE TRIAD_MsgId CHARACTER;
DECLARE TRIAD_MssgId CHARACTER;
DECLARE SQLState1 CHARACTER;
DECLARE SQLErrorText1 CHARACTER;
DECLARE StatCode CHARACTER;
DECLARE SQLERRORMSG CHARACTER;
DECLARE DefaultOrig CHARACTER;
DECLARE DefaultDest CHARACTER;
DECLARE SQLCode1 INTEGER;
DECLARE SQLNativeError1 INTEGER;
DECLARE QNbr INTEGER;
DECLARE I INTEGER;
DECLARE ProcessId CHARACTER;
DECLARE RouterType CHARACTER;
SET OutputRoot.MQMD.CorrelId = OutputRoot.MQMD.MsgId;
SET TRIAD_MsgId = OutputRoot.MQMD.MsgId;
SET TRIAD_MssgId = SUBSTRING(TRIAD_MsgId FROM 3 FOR 4 ;
SET OutputLocalEnvironment = InputLocalEnvironment;
SET StatCode = 'S';
SET DefaultOrig = 'LCLS';
SET DefaultDest = 'LCM ';
-- SET RouterType = 'TRD_XML_DC';
/* Process Id determined by TRD_XML_Determine_ProcessID
--update to reflect getting id from RFH2 header or XML
IF InputRoot.MQRFH2 IS NULL THEN
DECLARE XMLMessage REFERENCE TO InputRoot.XMLNSC.TriadMessage.TriadRouteInfo;
IF lastmove(XMLMessage) THEN
SET ProcessId = XMLMessage.RoutingProcessId;
END IF;
ELSE
SET ProcessId = InputRoot.MQRFH2.usr.RoutingProcessId;
END IF;
*/
ROUTING : BEGIN ATOMIC -- atomic block restricts the processing to be single threaded for setting the cache
IF CacheQueueTableDev.valid IS NULL THEN
SET CacheQueueTableDev.DestinationData[] =
(
SELECT A.PROCESS_ID, A.MESSAGE_TYP, A.ORIGINATING_SYS_CD, A.DESTINATION_SYS_CD, B.NEXT_STEP_QUEUE_NM, B. NEXT_STEP_NM
FROM Database.EBADEV.EBA001_TRIAD_PRCSS as A, Database.EBADEV.EBA002_TRD_PRC_STP as B
WHERE A.TRIAD_PROCESS_ID = B.FK_TRIAD_PRCSS_ID
);
SET CacheQueueTableDev.valid = true;
END IF;
END ROUTING ; -- end of ROUTING atomic block
SET Environment.Route[] =
(
SELECT S.MESSAGE_TYP, S.NEXT_STEP_QUEUE_NM, S.NEXT_STEP_NM, S.ORIGINATING_SYS_CD, S.DESTINATION_SYS_CD
FROM CacheQueueTableDev.DestinationData[] as S
WHERE S.PROCESS_ID = InputLocalEnvironment.ScratchPad.RoutingProcessId
);[/b] |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Mar 24, 2008 1:11 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Are the ESQL files in different schemas? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
wraymore |
Posted: Mon Mar 24, 2008 1:37 pm Post subject: |
|
|
Centurion
Joined: 16 Aug 2005 Posts: 114 Location: Burlington, NC USA
|
No, we have just been using the default broker schema. |
|
Back to top |
|
 |
wraymore |
Posted: Wed Mar 26, 2008 12:58 pm Post subject: |
|
|
Centurion
Joined: 16 Aug 2005 Posts: 114 Location: Burlington, NC USA
|
By declaring a Broker Schema for the message flow other than the default, I was able to declare a different named Shared Row variable.
Looking forward to IMPACT 2008!!! |
|
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
|
|
|
|