Re: Help with NPE

From: Barry Lind <blind(at)xythos(dot)com>
To: David Hooker <dhooker(at)a4networks(dot)com>
Cc: "'M(dot) A(dot) Sridhar'" <m_a_sridhar(at)yahoo(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Help with NPE
Date: 2002-11-14 10:58:21
Message-ID: 3DD381CD.5070603@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

I checked in a patch that produces a better error message when this
situation arises.

--Barry

David Hooker wrote:
> This is because you tried to use a Connection that was closed. I agree
> that something other than a NPE should be thrown in this case.
>
> -----Original Message-----
> From: pgsql-jdbc-owner(at)postgresql(dot)org
> [mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of M. A. Sridhar
> Sent: Sunday, November 10, 2002 8:56 PM
> To: pgsql-jdbc(at)postgresql(dot)org
> Subject: [JDBC] Help with NPE
>
>
> Hello folks,
>
> I'm getting this NullPointerException from within the PostgreSQL JDBC
> driver,
> and I'm not sure what to make of it:
>
> java.lang.NullPointerException
> at
> org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:62)
> at
> org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connec
> tion.java:497)
> at
> org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Stateme
> nt.java:320)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Stateme
> nt.java:48)
> at
> org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1St
> atement.java:153)
> at
> zerocode.udm.PreparedStmtWithSql.executeQuery(PreparedStmtWithSql.java:1
> 75)
> at
> zerocode.udm.DbObjectStore._retrieveWithOptSql(DbObjectStore.java:1562)
> ....
>
> This seems to happen not immediately at application startup, but some
> time
> thereafter. When I first connect to the database, everything is fine,
> but
> after I leave the app idle for a while and use it again, it crashes.
> This
> could well be because there is something in my code base that keeps an
> open
> connection around for a while, but I was hoping for a more informative
> message if that were the case (such as "connection expired") instead of
> an
> NPE.
>
> I would greatly appreciate any help on this one.
>
> Thanks.
>
> =====
> ------
> M. A. Sridhar
> m_a_sridhar(at)yahoo(dot)com
>
> __________________________________________________
> Do you Yahoo!?
> U2 on LAUNCH - Exclusive greatest hits videos
> http://launch.yahoo.com/u2
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Scott Lamb 2002-11-14 12:41:24 Re: setUseServerPrepare & typecasts
Previous Message Barry Lind 2002-11-14 10:51:03 Re: setUseServerPrepare & typecasts