agrosner / agrosner/DBFlow

IllegalStateException: Cannot perform this operation because there is no current transaction

オープン
#1,719 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Kotlin
スター
4.8k
フォーク
593
平均マージ
1分
マージ済み PR(30日)
1

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。