4.4.4 Using the VIEW Buffer Type
VIEW is a built-in Oracle Tuxedo typed buffer. The VIEW buffer provides a way to use C structures and COBOL records with the Oracle Tuxedo system. The VIEW typed buffer enables the Oracle Tuxedo run-time system to understand the format of C structures and COBOL records based on the view description that is read at run time.
When allocating a VIEW, your application specifies a VIEW buffer type and a subtype that matches the name of the view (the name that appears in the view description file). The parameter name must match the field name in that view. Because the Oracle Tuxedo run-time system can determine the space needed based on the structure size, your application need not provide a buffer length. The run-time system can also automatically handle such things as computing how much data to send in a request or response, and handle encoding and decoding when the message transfers between different machine types.
The following examples show the use of the VIEW buffer type with a Jolt client and its server-side application.
- The listing “simpview.java Code Example” is the Jolt client that contains the code used to connect to Oracle Tuxedo and uses the VIEW buffer type.
- The listing “simpview.v16 Field Definitions” contains the Oracle Tuxedo VIEW field definitions.
- The listing “simpview.c Code Example” contains the server side C code for handling the input from the Jolt client.
The Jolt client treats a null character in a VIEW buffer string format as an end-of-line character and truncates any part of the string that follows the null.