Kevin Janvier Chinabalire
08/23/2018, 7:30 AMjava.lang.IllegalStateException: Cannot perform this operation because there is no current transaction.
It run for the first time then crash for second time
fun clearAndResetAllTables(): Boolean {
if (db== null) return false
// reset all auto-incrementalValues
val query = SimpleSQLiteQuery("DELETE FROM sqlite_sequence")
db!!.beginTransaction()
return try {
db!!.clearAllTables()
db!!.query(query)
db!!.setTransactionSuccessful()
true
} catch (e: Exception){
false
} finally {
db!!.endTransaction()
}
}
gildor
08/23/2018, 7:48 AM!!
Denis A
08/23/2018, 7:53 AMgildor
08/23/2018, 7:53 AMthose !!
Kevin Janvier Chinabalire
08/23/2018, 8:16 AMCannot perform this operation because there is no current transaction.
gildor
08/23/2018, 8:31 AMI do end the transactionThis error about begin transaction, not about end transaction Check that you begin transaction in all cases and that you don’t call this method concurrently