library/src/databases/bpdb/BP-DB.cc
// Attempt to close the bpdb handle.
Attempt to close the bpdb handle.
Attempt to close the bpdb handle .
BP_ERROR_T BP_DBClose(P_BPDB bpdb)
{
	if(!bpdb)
		return ERR_FAILURE;
	if(!BP_SQLiteClose(bpdb->sqlite))
	{
		BP_DBAddErrorMsg(bpdb, "Attempted to call BP_SQLiteClose within BP_DBClose and failed.  SQLite handle went bad somehow.");
		return ERR_FAILURE;
	}
	if(!BP_DBCloseMariaDBConnectionPool(bpdb))
	{
		BP_DBAddErrorMsg(bpdb, "Attempted to call BP_DBCloseMariaDBConnectionPool within BP_DBClose and failed.  BP_DBCloseMariaDBConnectionPool somehow went bad (likely dropped connections/timeouts).");
		return ERR_FAILURE;
	}
	BP_DestroyHashTableRegistry(bpdb->messages_reg);
	BP_DestroyHashTableRegistry(bpdb->system_hreg);
	return ERR_SUCCESS;
}
BP_ERROR_T BP_DBClose ( P_BPDB bpdb ) { if ( ! bpdb ) return ERR_FAILURE ; if ( ! BP_SQLiteClose ( bpdb -> sqlite ) ) { BP_DBAddErrorMsg ( bpdb , " " ) ; return ERR_FAILURE ; } if ( ! BP_DBCloseMariaDBConnectionPool ( bpdb ) ) { BP_DBAddErrorMsg ( bpdb , " " ) ; return ERR_FAILURE ; } BP_DestroyHashTableRegistry ( bpdb -> messages_reg ) ; BP_DestroyHashTableRegistry ( bpdb -> system_hreg ) ; return ERR_SUCCESS ; }
Attempt to close the bpdb handle.
Attempt to close the bpdb handle .
// ensure we have a bpdb to destroy // close our sqlite database handle // ensure mariadb connection pool closed // --- Only destroy registries after closures are ok ------------- // destroy messages registry if it exists // destroy the system hreg (destroys the initial struct as well as // all errata) // return indicating success