Return the transaction state for a database connection
#include <qdb/qdb.h> int qdb_gettransstate( qdb_hdl_t *db );
This function returns the transaction state for the specified database connection. If an SQL transaction is in progress over the connection, the function returns 1. If no SQL transaction is happening, 0 is returned. If there's an SQL error, -1 is returned (and you can use qdb_geterrmsg() to get the error string).
You can call qdb_gettransstate() to determine how to clean up after an SQL error; for example, if you execute several commands in a transaction and need to determine which statement is causing the error.
QNX Neutrino
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |