Result and Status Codes
Many space operations return a result object—or in C, a status value— or, in the case of batch operations, a list of result objects. The operations that return a Result always return a result even if the operation failed (likewise, a status is always returned in C). Result objects always contain a status code (which is the same as the status codes returned directly by the functions in C).
Each status code has one of three types: no error, error, or severe error. No error indicates that the operation was successful, and data was returned. Errors indicate that the operation was successful from a system standpoint, but no data could be returned (because there was no tuple in the space or because the tuple in the space was locked). Severe errors indicate that the operation failed because of a system problem. If the status indicates an error or severe error, it is possible to get an exception (or an error object in C) using the getError() or getSevereError() methods of the Result (or in C, using tibasError_GetError() or tibasError_GetSevereError()).
Result (and ResultList) also has convenience hasError() and hasSevereError() methods that return true if the Result object (or any of the Results contained in the list) has an Error or SevereError.
If the operation was successful and resulted in an tuple being returned, this tuple can be retrieved from the Result object using the getEntry method, in this case it is also possible to directly retrieve the tuple contained in that tuple using the Result object's getTuple method.
If one of the objects passed as an argument to the space method is invalid, this method will throw a runtime exception.
The following table lists status codes returned by TIBCO ActiveSpaces functions:
Constant | Type | Description |
---|---|---|
TIBAS_OK | no error | The operation was successful and a tuple was found. |
TIBAS_ALREADY_EXISTS | error | The operation failed because there is currently a tuple in the space for the requested key field(s) value(s). |
TIBAS_LOCKED | error | The operation failed because the tuple is locked by another thread or process (depending on the LockScope(). |
TIBAS_MISMATCHED_LOCK | error | The lock expired in the space and another member already locked the tuple. |
TIBAS_INCOMPATIBLE_TUPLE | error | The operation failed because the name of a field contained in the Tuple is incompatible with the space definition. |
TIBAS_MISMATCHED_TUPLE | error | The operation failed because the Tuple is incompatible with the space definition. |
TIBAS_INCOMPATIBLE_TYPE | severe error | The operation failed because two data types involved in an operation are incompatible |
TIBAS_LIMIT_EXCEEDED | error | The operation failed because a predefined limit on the space, such as capacity, has been exceeded. |
TIBAS_INVALID_ARG | severe error | The operation failed because an invalid argument was passed to an operation. |
TIBAS_SYS_ERROR | severe error | The operation failed because of a system error. |