Clarity

 View Only

  • 1.  connection to DB after a disconnection

    Posted 2 days ago

    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%" 



    -------------------------------------------


  • 2.  RE: connection to DB after a disconnection

    Broadcom Employee
    Posted 2 days ago

    There are retry parameters which can be added to connection string. Something like below in case of

    Oracle RAC - jdbc:oracle:thin:@(DESCRIPTION=(RETRY_COUNT=20)(RETRY_DELAY=10)(ADDRESS_LIST= (LOAD_BALANCE=ON) (ADDRESS=(PROTOCOL=tcp)(HOST=server1.xyz.com)(PORT=XXXX)) (ADDRESS=(PROTOCOL=tcp)(HOST=server2.xyz.com)(PORT=XXXX))) (CONNECT_DATA=(SERVICE_NAME=SERVICENAME)))

    MS SQL - ConnectRetryCount=5;ConnectRetryInterval=10

    But main thing is to understand the root cause why connectivity is getting dropped. 



    ------------------------------
    Thanks & Regards
    Suman Pramanik
    ------------------------------