Programming Guide



unload_data

Writes data received remotely via the middleware to target Panther variables

Synopsis

unload_data [CLEAR_ONLY]

Arguments

CLEAR_ONLY
Clears target Panther variables and does not attempt to write any data to them.

Environment

JetNet, Oracle Tuxedo

Scope

Client, Server

Description

The unload_data command writes to Panther variables data received from a re mote agent via middleware processing. The data is written into the variables according to the mapping established in a service_call or receive command invocation. This command is used in the default Panther unload handler. Use this command if you write your own unload handler.

An unload event is triggered whenever data is received from an external source whose contents can be written to a set of target Panther variables. For clients, external sources of data include service_return data from services requested and unsolicited messages. For servers, external sources of data are data sent from a client as part of a service request, such as arguments. The unload operation begins by first clearing all target Panther variables, even if there is actually no data to unload. The CLEAR_ONLY option ensures that the target Panther variables are cleared of old data even in the event of an error, and prevents new data from being written.

Example

For example, the following unload handler user_unload_handler calls an unqualified unload_data command:

proc user_unload_handler (callid, msg_source, method)
if (method == TP_ASYNCHRONOUS)
{
msg emsg "Data has arrived!"
}
// Do the unload
unload_data
return

The following client JPL installs this unload handler. The service reverse takes a string as input and reverses the characters for output:

// Client code:
vars receive_string
@app()->hdl_unload = "user_unload_handler
service_call "reverse" ("hello world", receive_string)
msg setbkstat "String unloaded", receive_string

Exceptions

If unload_data is called other than from an unload handler or subordinate procedures, a TP_INVALID_CONTEXT exception of severity TP_COMMAND is raised.

See Also

receive, service_call, service_return