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

Closing connection

 
david allen
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens if you do not close the connection to the database?
David
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on the database provider, but most of the time, the connection times out and get's closed automatically. Of course, if you are using connection pooling, there should always be open connections anyway.
Depending on the provider and your app, it isn't a huge deal if a connection doesn't get closed. But I have seen it cause some locking problems.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic