
Modernizing Oracle Tuxedo Applications with Python
By :

CARRAY
is an array of characters that may contain NULL
characters. It is also known as an X_OCTET
typed buffer in the XATMI specification. Unlike a STRING
typed buffer, you can use CARRAY
to exchange any binary data. Or you can serialize structured data using Protocol Buffers, Apache Thrift, Apache Avro, or similar methods to achieve a compact size, extensibility, and support different programming languages.
bytes
is the Python type that is automatically converted to and from the CARRAY typed buffer. Just by changing our client program, we would send CARRAY
to the service:
import tuxedo as t _, _, res = t.tpcall("TOUPPER", "Hello, world!".encode("utf8")) print(res)
Of course, the server will receive bytes
instead of str
, and malfunction, but you get the idea of how to move forward. We will not spend any time on that because it is now time to introduce the one true typed buffer you should use for all applications.