Part of the normal application development process involves including code to manage error conditions that can occur during program execution. To facilitate error handling the eXtremeDB runtime uses return codes to indicate the status of the runtime after execution of a function or method.
The C API runtime functions return three categories of return codes:
- Status codes that indicate a state of the database runtime. If not handled, these could lead to an error condition.
- Error codes that indicate that the runtime failed to perform the requested operation. The application can handle the error and continue running.
- Fatal error codes (exceptions); these indicate that any further use of the database runtime is not possible. A fatal exception is usually a sign of a bug in either the application code or (rarely) the database runtime code.
These return codes require appropriate handling in the application. In the Java and C# APIs, class methods may return no value (void), a
long
value representing an object’sautoid
, or aboolean
value representing success or failure. For example in Java:The Connection method
startTransaction()
returns no valueThe Connection method
insert()
returns theautoid
of the inserted object or nullThe Cursor method
moveNext()
returnstrue
if a next object exists, otherwisefalse
However, whenever a fatal error occurs, an exception will be thrown indicating the source of the error.
Please use the links below to view detailed explanations and examples for your development environment:
C Handling return codes and error conditions in C C++ Handling return codes and error conditions in C++ Java Handling return codes and error conditions in Java Python Handling return codes and error conditions in Python C# Handling return codes and error conditions in C#