IllegalStateException: getDatabase called recursively in Migration even when using databaseWrapper
See original GitHub issueDBFlow Version: 4.1.2
Bug or Feature Request: Recursive Database call
Description: I’m using the Database wrapper to perform a select
during a migration (in order to set the value of one column to the value of an associated column), and even though I’m using the Database wrapper provider in migrate()
I am getting an IllegalStateException
saying that the database is being accessed recursively.
Here’s what I’m doing (in Kotlin):
@Migration(version = 3, database = AppDatabase::class)
class Migration3 : BaseMigration() {
override fun migrate(database: DatabaseWrapper) {
val messages = SQLite.select().from(Message::class).queryList(database)
messages.forEach {
(update<Message>()
set Message_Table.folder_path.eq(it.folder?.path)
where Message_Table.messageId.eq(it.messageId))
.execute(database)
}
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
IllegalStateException: getDatabase called recursively in Migration ...
IllegalStateException : getDatabase called recursively in Migration even when using databaseWrapper.
Read more >getDatabase called recursively during database migration
Caused by: java.lang.IllegalStateException: getDatabase called recursively at android.database.sqlite.SQLiteOpenHelper.
Read more >[Fixed]-Android sqlite getdatabase called recursively
I have got a problem with my database. When the app start it should create the database with the tables if they not...
Read more >[Problem] Android SQLIte Database Development ...
... the app crashes with an 02-24 10:45:54.636: E/AndroidRuntime(10845): java.lang.IllegalStateException: getDatabase called recursively
Read more >Patterns of Enterprise Application Architecture - Yes PDF
Even though this technology was new, we did have the benefit of ... ber that he came up with the name for Special...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
in
5.0.0-alpha1
this has been fixed. code gen now resembles as follows:we pass in db wrapper everywhere and is pretty much a requirement in every db method now.
closing as its fixed.