简体   繁体   中英

Does force close of a Java application cause Database connection leakage

While running a Java application from NetBeans, and the application connects to a remote database, if we try to kill the application from NetBeans using the Stop button, will it cause a database connection leakage?

If so.. where should we set the properties to close all Database connections before killing the running instance of the application.

There are two sides where a connection can be leaked.

Within the Java software:

You really can ignore this because the application will be killed soon.

Within the database:

This will cause problems, BUT every single network server application will check if a connection breaks away and free resources.

So I don't think you will get problems, because the database will mark the connections as invalid and free all resources.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM