zabbix-agent2/src/libs/zbxdb/db.c
/******************************************************************************
 *                                                                            *
 * Function: zbx_db_begin                                                     *
 *                                                                            *
 * Purpose: start transaction                                                 *
 *                                                                            *
 * Comments: do nothing if DB does not support transactions                   *
 *                                                                            *
 ******************************************************************************/
zbx_db_begin

Purpose: start transaction

Comments: do nothing if DB does not support transactions
zbx_db_begin Purpose : start transaction Comments : do nothing if DB does not support transactions
int	zbx_db_begin(void)
{
	int	rc = ZBX_DB_OK;
	if (txn_level > 0)
	{
		zabbix_log(LOG_LEVEL_CRIT, "ERROR: nested transaction detected. Please report it to Zabbix Team.");
		assert(0);
	}
	txn_level++;
#if defined(HAVE_MYSQL) || defined(HAVE_POSTGRESQL)
	rc = zbx_db_execute("begin;");
#elif defined(HAVE_SQLITE3)
	zbx_mutex_lock(sqlite_access);
	rc = zbx_db_execute("begin;");
#endif
	if (ZBX_DB_DOWN == rc)
		txn_level--;
	return rc;
}
int zbx_db_begin ( void ) { int rc = ZBX_DB_OK ; if ( txn_level > 0 ) { zabbix_log ( LOG_LEVEL_CRIT , " " ) ; assert ( 0 ) ; } txn_level ++ ; #if defined ( HAVE_MYSQL ) || defined ( HAVE_POSTGRESQL ) rc = zbx_db_execute ( " " ) ; #elif defined ( HAVE_SQLITE3 ) zbx_mutex_lock ( sqlite_access ) ; rc = zbx_db_execute ( " " ) ; #endif if ( ZBX_DB_DOWN == rc ) txn_level -- ; return rc ; }
Function: zbx_db_begin                                                     
                                                                            
 Purpose: start transaction                                                 
                                                                            
 Comments: do nothing if DB does not support transactions
Function : zbx_db_begin Purpose : start transaction Comments : do nothing if DB does not support transactions