private boolean executeSpecial ( String sql , Object [ ] bindArgs , int connectionFlags , CancellationSignal cancellationSignal ) { if ( cancellationSignal != null ) { cancellationSignal . throwIfCanceled ( ) ; } final int type = DatabaseUtils . getSqlStatementType ( sql ) ; switch ( type ) { case DatabaseUtils . STATEMENT_BEGIN : beginTransaction ( TRANSACTION_MODE_EXCLUSIVE , null , connectionFlags , cancellationSignal ) ; return true ; case DatabaseUtils . STATEMENT_COMMIT : setTransactionSuccessful ( ) ; endTransaction ( cancellationSignal ) ; return true ; case DatabaseUtils . STATEMENT_ABORT : endTransaction ( cancellationSignal ) ; return true ; } return false ; }
Performs special reinterpretation of certain SQL statements such as BEGIN COMMIT and ROLLBACK to ensure that transaction state invariants are maintained .