0

With Derby you're specifically suppose to call:

DriverManager.getConnection("jdbc:derby:myDatabase;shutdown=true");

When you want to shutdown the database. However with BoneCP you do:

BoneCPConfig config = new BoneCPConfig();
config.setJdbcUrl("jdbc:derby:myDatabase");
config.setXXX(...);
... 
BoneCP connectionPool = new BoneCP(config);

// shutdown connection pool
connectionPool.shutdown();

However with derby you need to call the shutdown command otherwise you can get some errors

So the question is how do I call that shutdown connection string within the BoneCP framework?

Community
  • 1
  • 1
Stephane Grenier
  • 15,527
  • 38
  • 117
  • 192

1 Answers1

0

In another related newer question, the following appears to be the same cause: "Unless you are running v0.8.1-beta2 or greater, set "disableConnectionTracking" to true in your config."

In other words you need both the derby connection URL as well as the proper config for BoneCP, at least for now...

Please note that you should expect an exception when SUCCESSFULLY shutting down derby: "A successful shutdown always results in an SQLException to indicate that Derby has shut down and that there is no other exception."

Community
  • 1
  • 1
Stephane Grenier
  • 15,527
  • 38
  • 117
  • 192