• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hunting leaking connections

 
Jussi Taimiaho
Ranch Hand
Posts: 40
  • 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
  • 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
Sheriff
Posts: 36007
422
Eclipse IDE Java VI Editor
  • 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
  • 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
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!