code: public void syncConnection(Protocol from, Protocol to) throws SQLException {
  
      if (from != null) {
  
        proxy.lock.lock();
        try {
          to.resetStateAfterFailover(from.getMaxRows(), from.getTransactionIsolationLevel(),
              from.getDatabase(), from.getAutocommit());
        } finally {
          proxy.lock.unlock();
        }
  
      }
    }
docs: When switching between 2 connections, report existing connection parameter to the new used
  connection.
  
  @param from used connection
  @param to   will-be-current connection
  @throws SQLException if catalog cannot be set