Open MJegorovas opened 1 year ago
I tried this on the JVM and it worked normally, and I was able to reproduce it with the native driver. I believe the native driver underwent some changes in 2.0 to better support the new memory model, and it looks like it's deadlocking.
Hi, I also noticed that In 2.0.0, the native driver seems limited to single active request. The mapper is executed before the close of the request. So in your case, the mapper start a new request inside an active one. So a deadlock appear... the driver wait the end of the first request.
You can bypass this limitation by run this select inside a transactionWithResult.
But yes, I also changed a lot of my code and I am very afraid that someone create by mistake a deadlock in my project with this behavior.
You can increase the size of the reader pool to avoid such deadlocks
NativeSqliteDriver(
schema = Database.Schema,
name = "app.db",
maxReaderConnections = 4, // find a value > 1 that matches your needs
)
SQLDelight Version
2.0.0
Application Operating System
Only tested native
Describe the Bug
On 1.x it was possible to do this:
After migrating to 2.0.0 functions like this freeze the app on
selectY()
. Is this intentional? I understand that I could execute these queries separately, but then unnecessary sqlDelight objects get created, instead of just mapping returned values to final object.Stacktrace
No response