SQLiteDatabase inTransaction - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for SQLiteDatabase inTransaction method.

This code example shows how to use the following methods:beginTransaction, endTransaction, inTransaction
        } 
    } 
     
    @Test 
    public void testInTransaction() throws Exception { 
        assertThat(database.inTransaction()).isFalse();
    	database.beginTransaction();
        assertThat(database.inTransaction()).isTrue();
    	database.endTransaction();
        assertThat(database.inTransaction()).isFalse();
    } 
 
    protected long addChuck() { 
        return addPerson(1234L, "Chuck"); 
    } 
 
    protected long addJulie() { 
        return addPerson(1235L, "Julie"); 
    } 
 
7
CodeRank
This code example shows how to use the following methods:endTransaction, inTransaction
        } 
    } 
     
    protected void rollbackTransaction(SQLiteDatabase dbCon) {
        try { 
            if (dbCon.inTransaction()) {
                dbCon.endTransaction();
            } 
        } 
        finally { 
            releaseDbConnection(); 
        } 
    } 
     
    protected SQLiteDatabase getDbConnection() {
        // singleton strategy 
        if (null == _db) {
            _db = getWritableDatabase();
        } 
        return _db;
5
CodeRank

Related SQLiteDatabase inTransaction Questions & Answers:

inTransaction Method Overview
Returns true if the current thread has a transaction pending.
See Code Examples for other Android SQLiteDatabase Methods: