1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Add the experimental sqlite3_transaction_hook() API.

FossilOrigin-Name: 093d8cd8e2f3a6af5d40cf810e396f4919eb5cef
This commit is contained in:
dan
2011-03-03 20:05:59 +00:00
parent 46c47d4677
commit 21e8d0126d
11 changed files with 282 additions and 32 deletions

View File

@@ -1845,6 +1845,12 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){
}
#endif
/* If a transaction-hook is configured, invoke it now to report on the
** successful commit operation. */
if( rc==SQLITE_OK ){
sqlite3TransactionHook(db, SQLITE_COMMIT, 0);
}
return rc;
}
@@ -1946,6 +1952,9 @@ int sqlite3VdbeCloseStatement(Vdbe *p, int eOp){
}
}
db->nStatement--;
assert( SAVEPOINT_ROLLBACK+1==SQLITE_ROLLBACK );
assert( SAVEPOINT_RELEASE+1==SQLITE_COMMIT );
sqlite3TransactionHook(db, eOp+1, p->iStatement);
p->iStatement = 0;
/* If the statement transaction is being rolled back, also restore the