Using ClientSession from java, I do this to check if the database is open:

 

try {

replace(somewhere, new ArrayInput(bytes));

} catch (IOException e) {
String msg = e.getMessage();

if (msg == null || !msg.contains(“No database opened”))

  throw e;

execute(new Check(databaseName));

replace(somewhere, new ArrayInput(bytes));

}

 

Is there a better way to detect if the database is open than testing the exception message text?

 

Kendall