In java application I need to check if data has been updated in my application and update the changes in other database. I have connection open to both database all the time till application terminates. Is it better to open the database connection at the interval of time or keep the connection open always?
Share
any typical database application will use a pool of connections. Pooled connections stay open so that the application doesn’t incur the cost of establishing a new connection every time it needs one. With pools even if you explicitly call close() on the connection from your code, it won’t close. Only the pool manager can close such a connection.