Force close pooled connection

1,247 views
Skip to first unread message

Eric Hwang

unread,
Sep 24, 2014, 8:12:30 PM9/24/14
to hika...@googlegroups.com
Hi,

We've been using the HikariCP pool and it's been really great!
Here's one question that's been stumping us for awhile:
How do you force kill a SQL connection that is being managed by Hikari? So we have a Connection object that was returned from Hikari, but we want to force close that connection rather than have it returned to the pool.

Thanks,
Eric

Brett Wooldridge

unread,
Sep 24, 2014, 8:52:22 PM9/24/14
to hika...@googlegroups.com
Hi Eric,

Thanks for using HikariCP.  If you want to force kill a connection, just call HikariDataSource.evictConnection(connection).  It will be closed and evicted from the pool.

-Brett

Eric Hwang

unread,
Sep 25, 2014, 3:50:17 AM9/25/14
to hika...@googlegroups.com
Thanks Brett!
Reply all
Reply to author
Forward
0 new messages