IllegalStateException: Cannot perform this operation because there is no current transaction
- Lingua principale
- Kotlin
- Stelle
- 4.8k
- Fork
- 593
- Merge medio
- 1m
- PR unite (30g)
- 1
Descrizione
DBFlow Version: 4.2.4
Bug or Feature Request: Runtime exception
Description:
The lib works well, but I found some crash issue from users after a migration.
The online log collected the exception, here is the stacktrace:
```
Caused by: java.lang.IllegalStateException: Cannot perform this operation because there is no current transaction.
at android.database.sqlite.SQLiteSession.throwIfNoTransaction(SQLiteSession.java:937)
at android.database.sqlite.SQLiteSession.endTransaction(SQLiteSession.java:410)
at android.database.sqlite.SQLiteDatabase.endTransaction(SQLiteDatabase.java:611)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:442)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:332)
at com.raizlabs.android.dbflow.structure.database.FlowSQLiteOpenHelper.getDatabase(FlowSQLiteOpenHelper.java:62)
at com.raizlabs.android.dbflow.config.DatabaseDefinition.getWritableDatabase(DatabaseDefinition.java:257)
at com.raizlabs.android.dbflow.sql.queriable.ModelLoader.load(ModelLoader.java:36)
at com.raizlabs.android.dbflow.sql.queriable.ListModelLoader.load(ListModelLoader.java:25)
at com.raizlabs.android.dbflow.sql.language.BaseModelQueriable.queryList(BaseModelQueriable.java:61)
at com.raizlabs.android.dbflow.sql.language.Where.queryList(Where.java:236)
```
The migration is about change the primary key of one table, and everything works well during the test.
the migration sql file is:
```
drop table SearchData;
create table SearchData
(
text TEXT,
url TEXT,
updateDate INTEGER,
primary key(text)
);
COMMIT;
```
How can I fix it?
Thanks
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.