Re: Unexpected NullPointerException in "processDeadParsedQueries()"

From: Morten Andersen <moa-ml(at)instadia(dot)net>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Unexpected NullPointerException in "processDeadParsedQueries()"
Date: 2007-01-05 08:09:09
Message-ID: 459E07A5.2080705@instadia.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi Kris,

Kris Jurka wrote:
>
>> In a multithreaded application I just got an unexpected
>> NullPointerException from the depth's of the JDBC-drivers cleanup
>> routine of parsed queries.
>>
>
> Is this something you can reproduce somewhat regularly or something that
> just happened once?

Unfortunately it is not reproduceable :-) - I just saw it once, in a
long running application with heavy load on the driver.

[SNIP]
>
> Neither of these look particularly likely to me. All entry points to
> QueryExecutorImpl that access these items are synchronized so I don't
> think the thread safety of the individual items are an issue.

After re-inspection, I think you are right. I definitely had a too
limited "scope" when looking for the cause, since I mostly/only looked
at registerOpenPortal() and processDeadPortals().

>
> Is your application multi-threaded and using a Connection per thread or
> does it use multiple threads per connection? If using Connection per
> thread it's even harder to believe this is a thread safety issue because
> you'll have a QueryExecutorImpl per Connection.

Multi-threaded, with only one thread using one connection at a time, but
using an Apache Commons Pool, so over time the same connection will be
used from several threads.

But given the issues with the synchronization on all entry points, as
you pointed out, I think you are right, in that neither of my two
suggestions to what the cause of the original stacktrace could be, are
correct.

So since I don't have any other good ideas to what it could be, and
since I only saw it once (and nobody else reported a similar issue), we
should probably just ignore the error as not-reproducable.

But thanks for taking your time to answer, and for looking into this issue.

Best Regards
Morten Andersen,
Instadia A/S, Denmark

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Ravi Periasamy 2007-01-05 14:48:47 Re: issues with Statement.getTimestamp(int, Calendar)
Previous Message Ken Johanson 2007-01-05 07:16:46 Re: Support for DatabaseMetadata: getCatalogName, getTableName,