#define afgs_command_begin connection   )     afgs_command_execute_non_query_with_con(connection, "BEGIN")

Macro definition which performs a BEGIN operation over the given connection.

This macro is a sort way to write a BEGIN operation on the given connection. You can use directly afgs_command_execute_non_query_with_con function to perform the same operation.

Here is an example:

 // inside some af-arch service at the server side

 // begin the transaction 
 if (afgs_command_begin (connection)) {
      AFGS_ERROR ("Unable to initialize transaction", COYOTE_CODE_ERROR);
        return TRUE;
See also:

  • AfGsConnection, how to get a connection to perform SQL operations using the same connection/context.

  • afgs_command_rollback, undo previous operation and get the database stated, and the connection, at the state where the previous begin operation was issue.

  • AFGS_ROLLBACK_ERROR, a way to cancel previous operation, release the connection, and reply with AFGS_ERROR macro.

connection The connection where the BEGIN operation will be performed.
TRUE if the BEGIN operation was allowed and successfully finished. Otherwise FALSE is returned.