Search code examples
jdbchikaricpvoltdb

setting TopologyChangeAware on jdbc voltdb client


I am making a jdbc connection to voltdb, how to make this connection TopologyChangeAware. over here i am using Hikari.


Solution

  • Finally got answer

    For now, the jdbc client does not have a TopologyChangeAware property, but there is a similar one called autoreconnect that we can put into your connection URL.

    It is described in the docs here:usingvoltdb jdbc

    It looks something like this:

    Connection c = DriverManager.getConnection(
     "jdbc:voltdb://svr1:21212,svr2:21212?autoreconnect=true");
    

    When set to true, the jdbc client will automatically try to reconnect to any nodes that disconnect until they rejoin the cluster.