bret barker wrote:
I've been having a persistent problem with intermittent
NullPointerExceptions in OQLQueryImpl.java, in the hasMore() method.
This issue has been discussed on the list previously:
http://www.mail-archive.com/[email protected]/msg01688.html
http://www.mail-archive.com/[email protected]/msg02657.html
and has a bug related to it, here:
http://bugzilla.exolab.org/show_bug.cgi?id=830
I grabbed the latest code from CVS (as of 2002/12/10) and rebuilt the
jar file. That code has the finalize() methods removed in
OQLQueryImpl.java. This resulted in a lower frequency of these errors,
but they were still occurring.
Guess we'll have to reopen this one. Can you send a test case for this ?
Next, I tried the suggestion in the old mailing list posting noted above, which is dated way back on 2001/09/27, that advises to make the OQLEnumeration inner class non-static. That change seems to have solved the problem. So my question is, why hasn't this fix been applied to the source in CVS?
The fix was to remove the close in finalize method : we shouldn't rely on the garbage collector to release resources. The best way seems to explicitly close the Query after iterating over the results, which means the application must keep a handle on the Query object.
At least it doesn't break other test cases (tested on Oracle)...Are there side-effects to that change that I'm not aware of?
We can make the OQLEnumeration non static to avoid the NullPointer, but
the only way to close the underlying preparedstatement is to close
the Query.
Maybe we could change OQLEnumeration to close the query in its close
method...
--
Mickael Guessant
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
