0

Imagine having an active BoneCP jdbc connection pool when the network connectivity goes down, then comes back after a minute. In order to automatically reconnect and recreate the pool, how should BoneCP be configured? Currently if I try this, all jdbc connections remain available in the pool and each time my code tries to use them, I get exceptions: "java.sql.SQLException: JZ0C0: Connection is already closed."

Update: Looks like BoneCP may not support this. Does anyone know if (and how) other connection pooling frameworks resolve this problem?

Faustas
  • 350
  • 1
  • 2
  • 10

1 Answers1

0

If network goes down, driver should throw an exception which is then caught by BoneCP and destroys all existing connections.

wwadge
  • 3,506
  • 1
  • 19
  • 28
  • 1
    No, it doesn't happen at least in my case (using Sybase drivers). The exception is not thrown right at the network going down. The exception is thrown only after the bad connection is attempted to be used to execute SQL statement. Yet, even then BoneCP does not recycle the connection. – Faustas Jan 30 '13 at 18:56