Thread
#exposed
    r

    rikusen0335

    2 years ago
    is there any method like
    Database.disconnect
    s

    spand

    2 years ago
    I dont think there is a standard JDBC but we have one on
    HikariDataSource.close()
    tapac

    tapac

    2 years ago
    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

    2 years ago
    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.
    tapac

    tapac

    2 years ago
    val db = Database.connect(...)
    // .... your code
    TransactionManager.closeAndUnregister(db)
    r

    rikusen0335

    2 years ago
    Oh thanks! The code works great