Example usage for android.database.sqlite SQLiteConnection setOnlyAllowReadOnlyOperations

List of usage examples for android.database.sqlite SQLiteConnection setOnlyAllowReadOnlyOperations

Introduction

In this page you can find the example usage for android.database.sqlite SQLiteConnection setOnlyAllowReadOnlyOperations.

Prototype

void setOnlyAllowReadOnlyOperations(boolean readOnly) 

Source Link

Usage

From source file:io.requery.android.database.sqlite.SQLiteConnectionPool.java

private void finishAcquireConnectionLocked(SQLiteConnection connection, int connectionFlags) {
    try {/* w ww  .  j  a v a  2s  .  c  o m*/
        final boolean readOnly = (connectionFlags & CONNECTION_FLAG_READ_ONLY) != 0;
        connection.setOnlyAllowReadOnlyOperations(readOnly);

        mAcquiredConnections.put(connection, AcquiredConnectionStatus.NORMAL);
    } catch (RuntimeException ex) {
        Log.e(TAG, "Failed to prepare acquired connection for session, closing it: " + connection
                + ", connectionFlags=" + connectionFlags);
        closeConnectionAndLogExceptionsLocked(connection);
        throw ex; // rethrow!
    }
}