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


Chapter 2 TIBCO ActiveSpaces Fundamentals : What are Tuples and Results?

What are Tuples and Results?
This section describes tuples and results.
Tuples
A tuple is similar to a row in a database table: it is a container for data. Specifically, it is a sequence of named elements called fields (similar to the columns in a database table) which contain values of a specific type. Each tuple in a space represents a set of related data.
Fields have a name and a type. A tuple can be seen as a kind of map on which fields can be 'put' or 'removed'. A tuple can also be seen as a self-describing message. Tuples are platform independent, and can be serialized and deserialized.
When a tuple is stored into a space, the fields that it contains must match the names and types of the fields described in the space definition. If there is a type mismatch between a field contained in the tuple and the type of the field defined in the space field definition, then the software may perform an automated field conversion if possible, or the operation will fail.
Table 4, Field Type Conversions shows which type conversions are supported. The letters in the table have the following meanings:
x: Conversion is supported with no loss of precision.
l:  Conversion is supported, but with loss of precision.
N  Conversion is not supported.
There is a get and put method for each type of field. In Java, an overloaded put method is also provided for convenience.
Some of the fields in a tuple are considered as key fields, as specified in the space’s definition.
Results
Most batch space operations return results (or collections of results). Results objects contain information about the result of the operation and are always returned by those operations regardless of the operation being a success or a failure.
A result object contains a status value indicating whether the operation completed successfully, and if so, whether or not an entry is contained in the result, or whether the operation failed and the result contains an exception object.
See Appendix A, Result and Status Codes for more detailed information on results.

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