Re: QueryExecutor NullPointerException invalid Connection?

From: "Dave Cramer" <Dave(at)micro-automation(dot)net>
To: "'Daniel Germain'" <daniel(dot)germain(at)gipsynet(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: QueryExecutor NullPointerException invalid Connection?
Date: 2001-12-24 12:14:11
Message-ID: 006701c18c74$7fb33330$8201a8c0@inspiron
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Daniel,

The problem is likely in how Enhydra/posgtres is determing if the
connection is valid or not. Do you know how this is done?

Dave

-----Original Message-----
From: pgsql-jdbc-owner(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of Daniel Germain
Sent: Friday, December 21, 2001 1:59 PM
To: pgsql-jdbc(at)postgresql(dot)org
Subject: [JDBC] QueryExecutor NullPointerException invalid Connection?

Hi,

We keeps having these kind of random errors.

*** Caused by:
java.lang.NullPointerException
at
org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:61)
at org.postgresql.Connection.ExecSQL(Connection.java:376)
at org.postgresql.jdbc2.Statement.execute(Statement.java:130)
at
org.postgresql.jdbc2.Statement.executeQuery(Statement.java:54)
at
org.postgresql.jdbc2.PreparedStatement.executeQuery(PreparedStatement.ja
va:9
9)
at
com.lutris.dods.builder.generator.query.QueryBuilder.executeQuery(QueryB
uild
er.java:1541)

*** Caused by:
java.lang.NullPointerException
at
org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:61)
at org.postgresql.Connection.ExecSQL(Connection.java:398)
at org.postgresql.Connection.ExecSQL(Connection.java:381)
at org.postgresql.Connection.setAutoCommit(Connection.java:834)
at
com.lutris.appserver.server.sql.standard.StandardDBConnection.reset(Stan
dard
DBConnection.java:285)

QueryExecutor:
public java.sql.ResultSet execute() throws SQLException
{

int fqp = 0;
boolean hfr = false;

line 61-> synchronized (pg_stream)

>From my investigation pg_stream is set to null when ever a connection
>is
closed.

We are using the lastest "Developement driver" from CVS 2001/12/20. We
are not using the lastest stable PostgreSQL 7.1.x Java 2 drivers since
we need some patches that were applied only on the developement version.
We are using Enhydra3.1 from Lutris as the database layer and everything
is working fine with the same code but with Microsoft SQLServer, so my
guess is that this problem is more Postgres related than Enhydra. I was
not able to find any reference to this problem elsewhere.

Enhydra manages its own connection pool, and check if the database
connection is valid and remove it when appropriate but for some reason
it seem to get and invalid one with this null pointer.

TIA

Daniel

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2001-12-24 12:15:31 Re:
Previous Message Rene Pijlman 2001-12-24 08:40:49 Re: PostgreSQL JDBC - trouble with catching exceptions