I asked this question on stack overflow a few days...
# exposed
z
I asked this question on stack overflow a few days ago about duplicate queries being sent to the database over the multiple HikariCP connections. https://stackoverflow.com/questions/76410664/exposed-runs-query-on-all-hikaricp-open-connections Is anyone here able to help? I didn't really do anything beyond the initial setup guided by the Ktor documentation (re: getting started with Exposed and HikariCP), so I'm guessing there is just something simple I'm missing. Thank you.
d
This is just a guess, but testing costs only a minute.... Exposed puts information in the thread and in a Ktor route you are inside a coroutine. So I think you should try it with newSuspendedTransaction. At least I have no problems with it in combination with Ktor.
z
sad panda
Copy code
suspend fun fetchEntity(): ControlEntity? = newSuspendedTransaction(<http://Dispatchers.IO|Dispatchers.IO>) {
        ControlEntity.find { ControlTable.identifier eq identifier }.firstOrNull()
    }
same error
it even shows being run on separate coroutines
resolved
problem:
i'm an idiot