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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top