Sometimes we find that clarity lost connection with database
ERROR 2025-07-11 22:11:11,111 [https-jsse-nio2-8080-exec-1354] filter.RequestTenantIdExtractor (none:none:none:none)
com.niku.union.config.ConfigurationException: Could not retrieve a valid tenant.
and clarity get reconnected after a service restart.
Sometime there were works or failures on database or network, other time the cause is not clear.
The question here is how to deal with these losses of the connection with DB?
From beacon logs we can see following error:
java.nio.channels.AsynchronousCloseException
java.nio.channels.AsynchronousCloseException
01:50:12.069 [jgroups-415,CLRTY-SA,serverA-35859] ERROR org.jgroups.protocols.JDBC_PING - JGRP000115: Could not open connection to database
java.sql.SQLRecoverableException: IO Error: Connection reset by peer, Authentication lapse 12658 ms.
...
java.sql.SQLRecoverableException: IO Error: Connection reset by peer, Authentication lapse 22051 ms.
....
Caused by: java.io.IOException: Connection reset by peer, Authentication lapse 22051 ms.
....
Caused by: java.io.IOException: Connection reset by peer, Authentication lapse 1 ms.
....
... 20 more
01:51:10.857 [jgroups-415,CLRTY-SA,serverA-35859] ERROR org.jgroups.protocols.JDBC_PING - JGRP000220: Failed to store PingData in database
Is it a good practice to monitor error strings from logs and then automate a reconnection?
"com.niku.union.config.ConfigurationException: Could not retrieve a valid tenant"
or
"%JDBC_PING - JGRP000220%"
-------------------------------------------