File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes IDEs, Version Control and other tools and the fly likes plugin - DB connection leak Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "plugin - DB connection leak" Watch "plugin - DB connection leak" New topic

plugin - DB connection leak

Muse Ran
Ranch Hand

Joined: Sep 17, 2008
Posts: 317
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

Tomorrow will surely be a new day!!!
Martijn Verburg

Joined: Jun 24, 2003
Posts: 3275

Connection leak? What sort of connection leaks? Are you talking JDBC/RMI/Socket?

Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Muse Ran
Ranch Hand

Joined: Sep 17, 2008
Posts: 317
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.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17421

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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: plugin - DB connection leak
It's not a secret anymore!