This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "plugin - DB connection leak" Watch "plugin - DB connection leak" New topic
Author

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
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

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
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
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961
    
  19

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
 
subject: plugin - DB connection leak
 
Similar Threads
WA #1.....word association
Jboss connection pool not releasing the connection from pool
OutOfMemoryError caused by PreparedStatements held in Connection
java.sql.SQLException: DBCP could not obtain an idle db connection, pool exhausted
RogueWave connection pooling inactive session Oracle V$session