On Mon, 13 May 2002 11:03:41 +0200, Jan Ypma wrote:

Another one falling into this deeeeeep hole. :-(
It's again a bug caused by the sad finalize() method in OQLQueryImpl.java.
To get around it, try this:
in org.exolab.castor.jdo.engine.OQLQueryImpl.java
in line 519 and 706 (roughly) just comment out the finalize method.

What happens here: As soon as the QueryResults and/or the Query itself are
garbage collected (that happend REALLY soon in the hotspot engine when the
optimizer "knows" that the variable isn't used anymore...), it is closed, 
hence the npe as the sql resultset is nulled on close().

I've removed these methods completely in my castor copy and have no problems
running the server for weeks. The only part to have an eye upon is to always
close the query or resultset properly to avoid a memory and/or sql
connection leak.



>Hello,
>
>I'm using castor JDO to load a simple set of objects from a database using a
>query, to generate a list view in a web iterface to the database. The list
>used to work nicely, but after I added more objects to the database, I kept
>getting NullPointerExceptions inside castor. The funny thing is, they don't
>occur ALWAYS, but they seem to occur more often when there are more objects
>to be loaded from the ResultSet generated from the query.
>
>Now there are about 15 objects to be loaded from the ResultSet through a
>simple QueryResults iterator, and somewhere in the middle it generated the
>NullPointerException while calling QueryResults.hasMore(). (see end of mail)
>
>Has anyone seen this before, or know how to solve this? Any help will be
>greatly appreciated.
>
>Kind regards,
>Jan Ypma
>
>The stack trace of the error:
>
>java.lang.NullPointerException
> at org.exolab.castor.jdo.engine.SQLTypes.getObject(SQLTypes.java:316)
> at
>org.exolab.castor.jdo.engine.SQLEngine$SQLQuery.loadSingleField(SQLEngine.ja
>va:1708)
> at
>org.exolab.castor.jdo.engine.SQLEngine$SQLQuery.loadRow(SQLEngine.java:1774)
> at
>org.exolab.castor.jdo.engine.SQLEngine$SQLQuery.fetchRaw(SQLEngine.java:1847
>)
> at
>org.exolab.castor.jdo.engine.SQLEngine$SQLQuery.nextIdentity(SQLEngine.java:
>1655)
> at
>org.exolab.castor.persist.QueryResults.nextIdentity(QueryResults.java:173)
> at
>org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQueryImp
>l.java:571)
> at
>org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQueryImp
>l.java:557)
>
>----------------------------------------------------------- 
>If you wish to unsubscribe from this mailing, send mail to
>[EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev
>
>


sincerely,

Patric Bechtel
IPCON Informationssysteme

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to