Hello. I have a question how to properly close con...
# exposed
f
Hello. I have a question how to properly close connection and free all `TransactionManager`s and `Transaction`s? I am using Hikari data source and tried multiple combinations, like:
Copy code
TransactionManager.closeAndUnregister(database)
        TransactionManager.resetCurrent(TransactionManager.manager)
        hikariDataSource.close()

// option 2
        TransactionManager.closeAndUnregister(database)
        TransactionManager.resetCurrent(null)
        hikariDataSource.close()
I used Intellij memory check to verify everything works, but there are still some classes which weren't deleted. I mean
ThreadLocalTransaction
and
ThreadLocalTransactionManager
. It causes issues when I create new connection. Some transactions will be broken then.
When I check referring objects of
ThreadLocalTransaction
, there is something called
EntityCache
, but I am not sure why this reference exists because I don't use
Exposed
DAO API. Only
DSL
.