https://kotlinlang.org logo
#squarelibraries
Title
# squarelibraries
j

Jason Zhao

11/29/2023, 10:55 PM
At least one of my PostgreSQL R2DBC update functions in SQLDelight gets stuck quite often. It never returns and also does not cause any effect in the database. I've tried pretty much everything that I can think of at this point, and this still happens. • The PostgreSQL database is running on the same computer as the server application • When I list running queries in PostgreSQL, nothing shows up, so the query isn't just stuck in Postgres (it's also just a simple UPDATE query) • I added print statements right before and after the calls to SQLDelight. Only the message printed before the statement gets shown and the one after the statement doesn't. • I tried running the calls in different coroutine scopes (for example launching it as a fire-and-forget operation in the global scope), it still gets stuck • I thought the issue might be my custom connection pool implementation, so I switched to r2dbc-pool and finally got it working today. However, the exact same issue still happens • I noticed that it seems to get worse / happen earlier with a lower connection pool size Is this a SQLDelight issue or an issue with my configuration? Honestly feels like I should stop trying to use r2dbc and switch to JDBC with
withContext(<http://Dispatchers.IO|Dispatchers.IO>)
instead because of how little support/testing seems to have been done (another example is how the BYTEA data type still doesn't work after I reported it a few months ago).
h

hfhbd

11/29/2023, 11:11 PM
Please fill an issue with a reproducer
j

Jason Zhao

11/29/2023, 11:12 PM
Do you know a way to get to the exact point where it gets stuck in SQLDelight's internal code? It might give me more hints to where the issue is, otherwise i would have to change a lot to make a reproducer and i don't know whether it will still occur then
For example can I edit SQLDelight's generated code without it being overridden when it compiles?
🚫 1
Well... i took the time to convert my code to JDBC and it is working very reliably now
10 Views