1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-18 10:21:03 +03:00

Remove the sqlite3_transaction_hook() API.

FossilOrigin-Name: b0015a1cfe63c924ee5f250aa08460522882009b
This commit is contained in:
dan
2011-03-16 09:49:14 +00:00
parent 296c76589f
commit 6566ebe1b6
11 changed files with 20 additions and 268 deletions

View File

@@ -764,26 +764,6 @@ int sqlite3_close(sqlite3 *db){
return SQLITE_OK;
}
/*
** Invoke the transaction-hook.
*/
void sqlite3TransactionHook(sqlite3 *db, int op, int iLevel){
assert( op==SQLITE_BEGIN || op==SQLITE_COMMIT || op==SQLITE_ROLLBACK );
assert( op==SQLITE_BEGIN || iLevel<db->iOpenTrans || iLevel==0 );
assert( op==SQLITE_BEGIN || iLevel<db->iOpenTrans || db->iOpenTrans==0 );
assert( op!=SQLITE_BEGIN || iLevel==db->iOpenTrans || iLevel==0 );
assert( op!=SQLITE_BEGIN || iLevel==db->iOpenTrans || db->iOpenTrans==1 );
if( op==SQLITE_BEGIN && iLevel!=db->iOpenTrans ) return;
if( op!=SQLITE_BEGIN && iLevel>=db->iOpenTrans ) return;
if( db->xTransCallback ){
db->xTransCallback(db->pTransArg, op, iLevel);
}
db->iOpenTrans = iLevel + (op==SQLITE_BEGIN);
}
/*
** Rollback all database files.
*/
@@ -816,10 +796,6 @@ void sqlite3RollbackAll(sqlite3 *db){
if( db->xRollbackCallback && (inTrans || !db->autoCommit) ){
db->xRollbackCallback(db->pRollbackArg);
}
/* If a transaction-hook is configured, invoke it now to report on
** the rollback operation. */
sqlite3TransactionHook(db, SQLITE_ROLLBACK, 0);
}
/*
@@ -1314,24 +1290,6 @@ void *sqlite3_preupdate_hook(
return pRet;
}
/*
** Register a callback to be invoked each time a transaction or savepoint
** is opened, committed or rolled back.
*/
void *sqlite3_transaction_hook(
sqlite3 *db, /* Database handle */
void(*xCallback)(void *, int, int), /* Callback function */
void *pArg /* First callback argument */
){
void *pRet;
sqlite3_mutex_enter(db->mutex);
pRet = db->pTransArg;
db->xTransCallback = xCallback;
db->pTransArg = pArg;
sqlite3_mutex_leave(db->mutex);
return pRet;
}
#ifndef SQLITE_OMIT_WAL
/*
** The sqlite3_wal_hook() callback registered by sqlite3_wal_autocheckpoint().