In my Java application I am establishing KDB connection using

```
private void initConnection() throws KException, IOException {
    conn = new c(host, port);
    conn.tz = TimeZone.getTimeZone(CONNECTION_TIMEZONE);
}

```

Then I use `conn` for inserting data asynchronously in tables successfully.

KDB server is restarted once in week and at that time as connection is reset by server I am getting an exception `java.net.SocketException`.  

Using the above exception I can again re-establish lost connection but this is not a decent solution as I lose batch etc. and I don’t want connection exception to be thrown at the time of insertion. 

Instead, is there a call-back/listener/Exception method in KDB API where API can inform java application upfront if a connection is closed by server / lost?