Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what if we do not close DB connection ?

 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, good day, wondering if we didn't close the DB Connection, what would happen ? thank you !
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34671
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alvin,
If we don't close a DB connection, we get something called a "connection leak." This drains resources from the system. If you are using a connection pool, it can also prevent you from obtaining a connection later on.
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, Jeanne Boyarsky
 
David Blaine
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:Alvin,
If we don't close a DB connection, we get something called a "connection leak." This drains resources from the system. If you are using a connection pool, it can also prevent you from obtaining a connection later on.

What is this connection leak, what exactly is drained and how is it drained ?

thanks
 
deepak veyan
Greenhorn
Posts: 10
Java MySQL Database Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

From my observations , the server would simply stop giving out new connections once the threshold is reached.This could lead into an over head situation for the application server administrator.You may have to forcefully close connections through the application server(might require restart mostly).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic