Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 7 Coding Considerations for Event, Location, and Derived Value Rules : Coding Rules for Remote Table Access

Coding Rules for Remote Table Access
Remote Table Access
The following rule illustrates replacing data by remote table access.

 
RULE EDITOR ===> SCROLL: P
REMOTE_ACCESS(LOCATION_PARM);
_ LOCAL FLD2;
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ FORALL TABLEA WHERE LOCATION = LOCATION_PARM & FIELD2 = | 1
_ ’A’ : |
_ TABLEA.FIELD3 = ’B’; |
_ FLD2 = TABLEA.FIELD2; |
_ REPLACE TABLEA WHERE LOCATION = LOCATION_PARM; |
_ END; |
_ ---------------------------------------------------------------------------

 
Peer-to-peer Access
In peer-to-peer access, a remote FORALL generally performs better than a remote INSERT or REPLACE. Example 1 provides better performance than Example 2 because in example 1 the system is able to buffer multiple occurrences from the remote FORALL and return them in a single peer-to-peer operation; whereas, in example 2, each occurrence requires an individual peer-to-peer data movement.
Example 1: A Single Peer-to-peer Operation
The following example illustrates a single peer-to-peer operation in a remote FORALL:

 
RULE EDITOR ===> SCROLL: P
PEER_ACCESS1;
_
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ FORALL REMOTE_TABLE : | 1
_ LOCAL_TABLE.* = REMOTE_TABLE.*; |
_ INSERT LOCAL_TABLE; |
_ END; |
_ ---------------------------------------------------------------------------

 
Example 2: Individual Peer-to-peer Operations
The following example illustrates individual peer-to-peer operations in a local FORALL:

 
RULE EDITOR ===> SCROLL: P
PEER_ACCESS2;
_
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ FORALL LOCAL_TABLE : | 1
_ REMOTE_TABLE.* = LOCAL_TABLE.*; |
_ INSERT REMOTE_TABLE; |
_ END; |
_ ---------------------------------------------------------------------------

 
See Also
TIBCO Object Service Broker Shareable Tools for information on tools for remote data accessing.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved