     }
     
     func updateStatementDidExecute() {
-        // Reset statementCompletion before didCommit or didRollback eventually
+        // Reset transactionState before didCommit or didRollback eventually
         // execute other statements.
-        let statementCompletion = self.statementCompletion
-        self.statementCompletion = .Regular
-        
-        switch statementCompletion {
-        case .TransactionCommit:
+        let transactionState = self.transactionState
+        self.transactionState = .WaitForTransactionCompletion
+        
+        switch transactionState {
+        case .Commit:
             didCommit()
-        case .TransactionRollback:
+        case .Rollback:
             didRollback()
         default:
             break

        
        sqlite3_rollback_hook(sqliteConnection, { dbPointer in
            let db = unsafeBitCast(dbPointer, Database.self)
            switch db.statementCompletion {
            case .TransactionErrorRollback:
                // A transactionObserver has rollbacked the transaction.
                // Don't lose this information.
                // Next step: updateStatementDidFail()
                break
            default:
                db.statementCompletion = .TransactionRollback
                // Next step: updateStatementDidExecute()
            }
            }, dbPointer)

            let db = unsafeBitCast(dbPointer, Database.self)
            do {
                try db.willCommit()
                db.transactionState = .Commit
                // Next step: updateStatementDidExecute()
                return 0
            } catch {
                db.transactionState = .RollbackFromTransactionObserver(error)
                // Next step: sqlite3_rollback_hook callback
                return 1
            }
