• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

plugin - DB connection leak

 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all
Is there any tool plugin for Eclipse to check any connection leak in the java source code. There are huge code base, and it is diffcult to search through each page.

thanks in advance
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Connection leak? What sort of connection leaks? Are you talking JDBC/RMI/Socket?
 
Muse Ran
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Basically i want to check the database connections - opened in the java source code and forget to close in the code. If i have few java files i can check manually, if the number is more, i cannt check each and every file. Thats why i am looking for tool (plugin) to check any opened java database connections in the code.

Thanks
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's no way to check statically. However you can set up to run for a while, monitor the network socket connections and if they begin to build up, take a profile snapshot and backtrace to see where the allocations were being made. Unfortunately, one of the best ways to leak connections is to not intercept exceptions and close the connection on the way back up the stack. Which is why I like the Spring Framework. It handles stuff like that.

Also, most of the ORM implementations afford some protection (or at least traceability) on things like this.

But that's small consolation when you inherit a lot of ugly old code done with brute-force JDBC.
reply
    Bookmark Topic Watch Topic
  • New Topic