#define AFGS_BEGIN_TRANSACTION con,
message   ) 
 

Value:

con = afgs_command_connection_pool_get  (); \
if (con == NULL) { \
        AFGS_ERROR (message, COYOTE_CODE_ERROR); \
        return TRUE; \
} \
if (! afgs_command_begin (con)) { \
        AFGS_ERROR (message, COYOTE_CODE_ERROR); \
        return TRUE; \
}
Allows to perform initial begin transaction operations.

While performing several operation, inside a transaction, at the server side, it is required to get a connection from the database connection pool, by using:

And later, it is required to perform a call to:

To initialize the SQL transaction.

Because this code is pretty much frecuent, this macro allows to perform the connection reservation plus the initial BEGIN operation. Here is an example on how to use this macro to initiate a transaction.

 AfGsConnection * connection;

 // init the transaction
 AFGS_BEGIN_TRANSACTION(connection, "Unable to start the transaction");
 // if the transaction initialization is properly performed, the code will
 // continue on executing on the next lines. If not, the function will return
 // generating a AFGS_ERROR call using the message configured.

See also AFGS_COMMIT_TRANSACTION.

Parameters:
con The connection variable that will contain the database connection.
message The message to be used if an error is found while performing this operation.