Michael
Michael

Reputation: 9402

Determining when a new transaction has started in SQLite

Is there any way in SQLite to determine when a new transaction has started, or which transaction is currently in progress?

The purpose for this is in a trigger which is logging certain changes to a database. As far as I can tell, a trigger has no indication as to whether the given operation is by itself or part of a set of other operations. Something like a transaction count would allow for a clear delineation of which changes occurred atomically at the same time (e.g. for the purpose of playback).

Upvotes: 1

Views: 111

Answers (1)

CL.
CL.

Reputation: 180010

SQLite has commit and rollback notification callbacks, which are called at the end of any transaction.

Upvotes: 1

Related Questions