Thank you for the pointer.


On Wed, Apr 10, 2013 at 2:27 AM, Dag Wanvik <dag.wanvik@oracle.com> wrote:
Hi,

Probably https://issues.apache.org/jira/browse/DERBY-4701. You could vote to get it fixed.

Thanks,
Dag


On 10.04.2013 03:38, Al Eridani wrote:

At the start of our application, we use a call to NetworkServerControl.ping() to verify that Derby is up.

We expect an exception to be thrown if the ping call fails and we try 40 times every half second before giving up.

It has reported to me that when port 1527 is blocked by packet filters, that call never returns or it takes a long time, maybe.

Is there something I can do to get ping to return normally or throw an exception quickly?

We are using Derby 10.9.1.0 with the following non-default configuration

datasource.className=org.apache.derby.jdbc.ClientDataSource
datasource.createDatabase=create
datasource.databaseName=/some/directory
datasource.portNumber=1527
datasource.serverName=some.server.name
datasource.user=someuser

The basic code is

    ClientDataSource cds = (ClientDataSource) dataSource;
    String serverName = cds.getServerName();
    int serverPort = cds.getPortNumber();

    InetAddress inetAddr = InetAddress.getByName(serverName);
    networkServerControl = new NetworkServerControl(inetAddr, serverPort);
    networkServerControl.start(null);

    for (int i = 0; i < 40; i++) {
      try {
    networkServerControl.ping();
      } catch (Exception e) {
    try {
      // Sleep for 1/2 second.
    } catch (InterruptedException ie) {
      break;
    }
      }
    }