Programming Guide |
Waits for service calls to return before processing resumes
wait [serviceCalls
] [ TIMEOUTtimeout
]
serviceCalls
- Specifies which service calls must return before processing resumes. If no service calls are specified, processing is suspended until the current service call returns. Use one of these keywords and its options:
FOR
[callid
]- Processing resumes when service call
callid
returns.FOR_ALL
[callSpec
]- Processing resumes when all the specified services return. If you omit
callSpec
, all outstanding service calls must return in order to resume processing.callSpec
can have one of these formats:
- (
callid
[,callid
]... )—A comma-delimited list of service call IDs, enclosed in parentheses, that specifies the service calls that must return before processing resumes.
TRANSACTION
—Processing resumes when all services associated with the current transaction return.FOR_ANY
[callSpec
]- Processing resumes when one of the specified services return. If you omit
callSpec
, processing resumes when any outstanding service call returns.callSpec
can have one of these formats:
- (
callid
, [callid
]...)—A comma-delimited list of service call IDs, enclosed in parentheses. Processing resumes when any of these calls returns.
TRANSACTION
—Processing resumes when any service associated with the current transaction returns.TIMEOUT
timeout
- Resume processing if the specified service calls do not return before
timeout
elapses.timeout
is a quoted string or variable whose format can specify a relative time (time elapsed after the wait command is issued) or an absolute time. If notimeout
is specified, all specified service calls must return before processing resumes.A relative
timeout
can be specified in this format:"[ +days
hours
::minutes
::]seconds
"Seconds are required; minutes, hours, or days (space delimiter between days and hours) can also be specified. If more than seconds is specified, the + symbol and the quotation marks are mandatory. If only seconds are specified, both are optional.
Note: JPL's colon preprocessor expands colon-prefixed variables. To prevent expansion of variables that contain colons, you must prefix literal colons with another colon (
::
) or a backslash (\:
).An absolute
timeout
can be specified in one of these ways:
JetNet, Oracle Tuxedo
Client, Server
The
wait
command suspends processing of its caller pending completion of the specified service calls or elapse of the specifiedtimeout
. If no service calls are specified, processing is suspended until the current service call returns. Processing can resume whether or not the specified calls return with the requested service. Whenwait
returns, it sets thetp_return
property to the number of service calls that returned while processing was suspended.The
wait
command activates theexception
,unload
andpost_request
handlers associated with any call that returns while the wait command executes.In the following example, the client code issues two service calls,
WITHDRAWAL
andBAL_INFO
, both asynchronous. Thewait
command includes theFOR_ALL
option, which prevents the same client from engaging in any other activity until both service calls return:vars err_msg
service_call service "WITHDRAWAL"( \
acct_id, \
{err_msg, transact_id, post_date}) ASYNCservice_call service "BAL_INFO"( \
acct_id, \
{message, cur_bal, avail_bal, cur_date}) ASYNCwait FOR_ALL
...
wait
can generate these exceptions: