The problem is that the onUpgrade method (as well as onCreate ) is encountered in the transaction and at the end establishes a successful transaction and completes it.
However, you have already completed the transaction in onUpgrade , which led to this error.
Relevant code from SQLiteOpenHelper :
... if (version != mNewVersion) { db.beginTransaction(); try { if (version == 0) { onCreate(db); } else { onUpgrade(db, version, mNewVersion); } db.setVersion(mNewVersion); db.setTransactionSuccessful(); } finally { db.endTransaction(); } } ...
source share