× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: jdbc handle leak problem solved
  • From: cujo@xxxxxxxxxx
  • Date: Wed, 31 May 2000 07:10:51 -0500

The native JDBC driver in v4r5 should not be able to run out of handles
(assuming Java 2 is used).  The object links throughout the JDBC driver
were changed to use WeakReferences and in places where we detect the
database is out of resource handles, we call the garbage collector for the
user.  All of the objects have finalize blocks which close their resources.

The major problem in the past (and the problem with doing this in Java 1.1)
is that we need the Java 2 garbage collector enhancements to be able to do
this.  Combined with the fact that you can now get some 6,000 statements
under a connection, it should be impossible to run out of resources.  This
doesn't mean that it is acceptable to stop closing your own JDBC resources.
Letting the driver do so is clearly going to be less efficient than doing
it yourself, but at least you are not going to see the system just stop
working.

I guess I can see where the ability to dump the resources under a JDBC
object would still be useful at times and we will consider it further.

Regards,

Richard D. Dettinger
AS/400 Java Data Access Team

"TRUE! nervous, very, very dreadfully nervous I had been and am; but why
WILL you say that I am mad?
The disease had sharpened my senses, not destroyed, not dulled them. "

- Edgar Allan Poe
"The Tell-Tale Heart"




"Alex Garrison" <agarrison@logtech.com> on 05/30/2000 02:25:13 PM

Please respond to JAVA400-L@midrange.com

To:   JAVA400-L@midrange.com
cc:
Subject:  jdbc handle leak problem solved




Followup for anyone interested in the sql handle leak problem I posted back
in March:

Around the end of March, I posted a message describing a sql handle leak
problem we were seeing.  At the time we were pretty sure it was a problem
with the sql cli layer in os/400.  After working with IBM the suggestion
was made that maybe we were not closing all our statements/result sets
properly.  Well I was willing to bet that we had carefully made sure
everything was good in our java code, but....  I did an audit myself of our
java code and found around 140 places where either the statement/result
sets werent closed or were not closed in the finally part of a
try/catch/finally block.  Our programmers went through four iterations of
auditing/changing the code till we were finally satisfied.

The result:  We have run over a whole week without running out of handles
as compared to running out within 24 hours prior to the audit.  If you are
having any kind of handle leak problem, I suggest you ignore your
programmer's pleas of innocence and audit the code carefully.

Suggestion to IBM:  Give me a way to ask the system how I'm doing on scarce
resources like handles (green screen command, system api, whatever).  I
know new releases dramatically increase the number of available handles per
job, but it would still be useful.

Alex Garrison


Followup for anyone interested in the sql handle leak problem I posted back in March:
 
Around the end of March, I posted a message describing a sql handle leak problem we were seeing.  At the time we were pretty sure it was a problem with the sql cli layer in os/400.  After working with IBM the suggestion was made that maybe we were not closing all our statements/result sets properly.  Well I was willing to bet that we had carefully made sure everything was good in our java code, but....  I did an audit myself of our java code and found around 140 places where either the statement/result sets werent closed or were not closed in the finally part of a try/catch/finally block.  Our programmers went through four iterations of auditing/changing the code till we were finally satisfied. 
 
The result:  We have run over a whole week without running out of handles as compared to running out within 24 hours prior to the audit.  If you are having any kind of handle leak problem, I suggest you ignore your programmer's pleas of innocence and audit the code carefully.
 
Suggestion to IBM:  Give me a way to ask the system how I'm doing on scarce resources like handles (green screen command, system api, whatever).  I know new releases dramatically increase the number of available handles per job, but it would still be useful.
 
Alex Garrison
 
  

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.