Re: QueryExecutor NullPointerException invalid Connection? - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: QueryExecutor NullPointerException invalid Connection?
Date
Msg-id 006701c18c74$7fb33330$8201a8c0@inspiron
Whole thread Raw
In response to QueryExecutor NullPointerException invalid Connection?  ("Daniel Germain" <daniel.germain@gipsynet.com>)
List 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@postgresql.org
[mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Daniel Germain
Sent: Friday, December 21, 2001 1:59 PM
To: pgsql-jdbc@postgresql.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@postgresql.org



pgsql-jdbc by date:

Previous
From: Rene Pijlman
Date:
Subject: Re: PostgreSQL JDBC - trouble with catching exceptions
Next
From: Ryouichi Matsuda
Date:
Subject: Failure in timestamptz of JDBC of 7.2b4