Question

Using JDBC to connect to a Derby database, after a while, Derby or JDBC close the connection automatically. (This may be called a "connection lifetime" value or a timeout value).

Where can I find out what the timeout value is? Is it Derby or JDBC that closes the connection? Is it an "idle timeout" value, so, if there is activity on that connection, will Derby or JDBC update so it closes the connection at (LastActivity + IdleTimeoutValue)?

I looked at a bunch of pages, including Connection timeout for DriverManager getConnection How to reestablish a JDBC connection after a timeout?

Was it helpful?

Solution

Neither Derby nor JDBC has any automatic timeout, so far as I know.

Here are the configurable behaviors of a Derby JDBC connnection: http://db.apache.org/derby/docs/10.8/ref/rrefattrib24612.html

I don't think that Derby is closing your connection.

I suspect that you have a network firewall, or VPN, or some other piece of equipment which is closing your apparently-idle TCP/IP connections.

Try reviewing your network configuration with your IT staff.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top