Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 909C99FA4BB for ; Fri, 5 Jan 2007 04:09:15 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 06962-05 for ; Fri, 5 Jan 2007 04:09:08 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.instadia.net (mail.instadia.net [80.165.96.2]) by postgresql.org (Postfix) with ESMTP id AF5889F946C for ; Fri, 5 Jan 2007 04:09:10 -0400 (AST) Received: from [10.0.0.14] (dev8.instadia.net [10.0.0.14]) by mail.instadia.net (Postfix) with ESMTP id 3AEC4D7379; Fri, 5 Jan 2007 09:09:09 +0100 (CET) Message-ID: <459E07A5.2080705@instadia.net> Date: Fri, 05 Jan 2007 08:09:09 +0000 From: Morten Andersen User-Agent: Debian Thunderbird 1.0.2 (X11/20060926) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kris Jurka Cc: pgsql-jdbc@postgresql.org Subject: Re: Unexpected NullPointerException in "processDeadParsedQueries()" References: <4589297C.208@instadia.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50 X-Spam-Level: X-Archive-Number: 200701/39 X-Sequence-Number: 16404 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