erratic problems with jdbc driver

From: Ari Halberstadt <ari(at)shore(dot)net>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: erratic problems with jdbc driver
Date: 1999-07-02 03:36:53
Message-ID: v04003a01b3a1df1c047c@[207.244.110.165]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

I've been getting some erratic exceptions in the jdbc driver. About 50% of
the time I get the a stack trace like the following:

java.lang.NullPointerException
at postgresql.util.PSQLException.translate(PSQLException.java:76)
at postgresql.util.PSQLException.<init>(PSQLException.java:45)
at postgresql.PG_Stream.ReceiveString(Compiled Code)
at postgresql.Connection.ReceiveFields(Compiled Code)
at postgresql.Connection.ExecSQL(Compiled Code)
at postgresql.jdbc2.Statement.execute(Compiled Code)
at postgresql.jdbc2.Statement.executeQuery(Compiled Code)
at com.magiccookie.sql.StatementForwarder.executeQuery(Compiled Code)
at com.magiccookie.sql.StatementWrapper.executeQuery(Compiled Code)
at com.magiccookie.photodb.Image.match(Compiled Code)
at com.magiccookie.photodb.Util.makeGalleryThumbnail(Compiled Code)
at _photography._photodb.___folder_gallery.render(Compiled Code)
at com.bitmechanic.gsp.GspServlet.renderTemplate(GspServlet.java:576)
at com.bitmechanic.gsp.GspServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at org.apache.jserv.JServConnection.run(JServConnection.java:359)
at java.lang.Thread.run(Thread.java:485)

This is erratic because sometimes the same exact query and code succeed,
but sometimes it fails. I think the NullPointerException is caused by a
null bundle, but this is actually triggered by an earlier exception that
gets lost in the process.

I added a print statement in PSQLException and this is what the
actual error is:

ERROR=postgresql.stream.ioerror
ARG=java.net.SocketException: Socket closed

It looks like the socket connection is being lost at random times while
running the query.

The query being run at the time is:

select
adjustments,description,ts,folder,notes,keywords,title,film,location,private,nam
e,ts from photo where id = 158

The calling code is iterating over a list of rows and retrieving info for
each row. It does not always fail when retrieving the same row: though the
query is the same it may be accessing a row with a different ID. You can
see the net effect of this at
<http://www.magiccookie.com/photography/photodb/folder-gallery.gsp>.
Sometimes all of the pictures are displayed, and sometimes only the first
few are displayed.

I had this problem with 6.05b1 and just upgraded to 6.5, but the problem
persists.

Environment: postgresql 6.5, sunos 5.6, Solaris_JDK_1.2.1_03_pre-release.

-- Ari Halberstadt mailto:ari(at)shore(dot)net <http://www.magiccookie.com/>

Browse pgsql-interfaces by date

  From Date Subject
Next Message Michael Mooney 1999-07-02 04:07:59 pgsqlODBC + Flick's Authentix
Previous Message Steven Bradley 1999-07-02 00:03:10 triggers and NOTIFY