 class DatabaseObservationBroker {
     unowned var database: Database
     var savepointStack = SavepointStack()
-    var transactionHookState: TransactionHookState = .pending
+    var transactionState: TransactionState = .none
     var transactionObservations = [TransactionObservation]()
     var activeTransactionObservations = [TransactionObservation]()
     

        #if SQLITE_ENABLE_PREUPDATE_HOOK
            sqlite3_preupdate_hook(database.sqliteConnection, { (brokerPointer, databaseConnection, updateKind, databaseNameCString, tableNameCString, initialRowID, finalRowID) in
                let broker = Unmanaged<DatabaseObservationBroker>.fromOpaque(brokerPointer!).takeUnretainedValue()
                broker.willChange(with: DatabasePreUpdateEvent(
                    connection: databaseConnection!,
                    kind: DatabasePreUpdateEvent.Kind(rawValue: updateKind)!,
                    initialRowID: initialRowID,

        cleanupTransactionObservations()
    }
    
    // Called from updateStatementDidExecute or updateStatementDidFails
    private func databaseDidRollback(notifyTransactionObservers: Bool) {
        savepointStack.clear()
        
        if notifyTransactionObservers {
