         sqlite3_update_hook(sqliteConnection, nil, nil)
         sqlite3_commit_hook(sqliteConnection, nil, nil)
         sqlite3_rollback_hook(sqliteConnection, nil, nil)
-    }
-    
-    private enum StatementCompletion {
-        // Statement has ended with a commit (implicit or explicit).
-        case TransactionCommit
-        
-        // Statement has ended with a rollback.
-        case TransactionRollback
-        
-        // Statement has been rollbacked by transactionObserver.
-        case TransactionErrorRollback(ErrorType)
-        
-        // All other cases (CREATE TABLE, etc.)
-        case Regular
     }
 }
 

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

    private var selectStatementCache: [String: SelectStatement] = [:]
    
    /// See setupTransactionHooks(), updateStatementDidFail(), updateStatementDidExecute()
    private var transactionState: TransactionState = .WaitForTransactionCompletion
    
    /// The transaction observers
    private var transactionObservers = [TransactionObserverType]()
