Re: Query Executor Problem

From: "Daniel Germain" <daniel(dot)germain(at)gipsynet(dot)com>
To: "Email User" <support(at)ebusinessoft(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Query Executor Problem
Date: 2002-11-06 15:34:15
Message-ID: CBEDKGKJPKEBDJECDAGLOEFECHAA.daniel.germain@gipsynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

In our case we had to make sure
to discard/close/clean the connection ourself
EVERYWHERE.
We realized that in some circonstances our application server
did not release and close properly the connection from our pool.

Usually it called connection.clearWarnings(),
connection.setAutoCommit(true);
and closes the connection whenever there was an exception.

Strange things happen when the GarbageCollector/Finalizer runs
and tries to call the method org.postgresql.Connection.finalize()
which calls org.postgresql.Connection.close which execute pg_stream=null;
And it is this variable pg_stream which is null in the QueryExecutor at
line 61. The finalizer seems to disrupt internal stuff that it should not
have (database socket?), anyway you should not rely on the finalize method.

From what I remember is that we make sure WE close the connection and
not the gargage collector.
The Connection.close instruction should be the last instruction you execute
on a connection.

Good luck.

Daniel

> -----Original Message-----
> From: Email User [mailto:support(at)ebusinessoft(dot)com]
> Sent: November 6, 2002 1:35 AM
> To: daniel(dot)germain(at)gipsynet(dot)com
> Cc: pgsql-jdbc(at)postgresql(dot)org
> Subject: Query Executor Problem
>
>
> Hi,
> Our web based application which is using postgresql version 7.1.3 is
> showing an error as follows.
>
> java.lang.NullPointerException
> at
> org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:61)
> at org.postgresql.Connection.ExecSQL(Connection.java:398)
> at org.postgresql.jdbc2.Statement.execute(Statement.java:130
> at org.postgresql.jdbc2.Statement.executeQuery(Statement.java:54)
> at
> com.ebusinessoft.gen.db.DatabaseUtilities.getQueryResults(Database
> Utilities.java:71)
> at com.ebusinessoft.ifos.rsmt.gentrip.doGet(gentrip.java:124)
> at com.ebusinessoft.ifos.rsmt.gentrip.doPost(gentrip.java:448)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
> at org.apache.tomcat.core.Handler.service(Handler.java:286)
> at
> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> at
> org.apache.tomcat.core.ContextManager.internalService(ContextManag
> er.java:797)
> at
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> at
> org.apache.tomcat.service.connector.Ajp12ConnectionHandler.process
> Connection(Ajp12ConnectionHandler.java:166)
> at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
> at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> at java.lang.Thread.run(Thread.java:484)
>
>
> This type of message occurs at random and we could not assess the
> reason for
> this. We greatly appreciate your help on this.
>
> Thanks
> Support
> support(at)ebusinessoft(dot)com
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2002-11-06 17:34:47 Re: SSL-Howto?
Previous Message mixer2002de 2002-11-06 15:25:46 SSL-Howto?