If I open up a JDBC connection in my java code and forget to close it, will it remain open for ever? Or is there a default time out value that I can specify somewhere?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In first place, you really need to fix the code to close it. No excuses.
As to the concrete question, that depends on the DB server used. It’s the DB server who will timeout and reclaim it. Refer the DB server specific administration manual for defaults and how to change it. In case of for example MySQL, it’s the
wait_timeoutsetting which defaults to 28800 seconds (8 hours).