https://kotlinlang.org logo
r

rikusen0335

11/26/2019, 11:28 AM
is there any method like
Database.disconnect
s

spand

11/26/2019, 11:54 AM
I dont think there is a standard JDBC but we have one on
HikariDataSource.close()
t

tapac

11/26/2019, 8:53 PM
Database.connect() doesn't create any real connection, but just collect all required data for it. So you don't need to disconnect anything. But if want unregister database and related TransactionManager please use TransactionManager.closeAndUnregister() function
But if you want to close Connection pool use @spand advise
r

rikusen0335

11/27/2019, 7:20 AM
Thanks. And also sorry, could you please tell me what
closeAndUnregister()
? I thought that would be
val db = Database.connection(...)
, but it isn't it.
I don't use Data Source so it's not for me now.
t

tapac

11/27/2019, 8:24 AM
Copy code
val db = Database.connect(...)
// .... your code
TransactionManager.closeAndUnregister(db)
r

rikusen0335

11/27/2019, 8:36 AM
Oh thanks! The code works great
👌 1
57 Views