File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hunting leaking connections

 
Jussi Taimiaho
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

to keep it short, a software running on WebLogic is leaking connections, so I'll need to fix this. The problem is not apparent, so it'll take a bit effort from me. I have a question about one case. Is this kind of structure any way vulnerable to leaking? I think not, but is it?


[ October 20, 2005: Message edited by: Jussi Taimiaho ]
 
dema rogatkin
Ranch Hand
Posts: 294
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks Ok for me. I do not see any reason to rethrow exception though. Very unlekely but if a close ps throws runtime exception you can miss con.close().
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33716
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

This is a bit dangerous. You are doing something with an open connection. Here, it is possible to abandon some of the original resources without closing them.
 
Jussi Taimiaho
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeanne Boyarsky:

This is a bit dangerous. You are doing something with an open connection. Here, it is possible to abandon some of the original resources without closing them.


I don't like this kind of structure either, but if I don't find the leak here I ain't going to touch classes using this style, since they are rather longish, and not written by me.

Thanks for the answers,
jussi
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic