Subject: [Pljava-dev] null pointer exception in pl/java jdbc driver
Date: Thu, 24 May 2012 09:44:21 -0400
Message-ID: <C35FDD5FDF7E584991A6AAF8F1A8425F0226AD50@ltischx01.lti.int> (raw)
References: <C35FDD5FDF7E584991A6AAF8F1A8425F0226AD3A@ltischx01.lti.int>
<oby4pb.x5oby4pb.wr42.7xr4.gnus@asuka.myrkraverk.com>
Johann 'Myrkraverk' Oskarsson writes:
>"Welty, Richard" <rwelty at ltionline.com> writes:
>> i'm having trouble chasing down what may be close to the last bug in
>> my pl/ java code, a null pointer when executing an update. are there
>> restrictions on what i can do inside a function with this jdbc driver?
>> at this point, the code has successfully done a select, found the rows
>> it wants and issued an http request to a solr search engine; now it
>> needs to delete the rows that triggered the successful update:
>The following code works for me. Can you give us the steps you are
>taking?
the framework is a system for doing push notifications to an Apache Solr search engine when certain metadata in a PostgreSQL database is updated.
There is an intermediate table, solr_index_event. anytime an entity needs to be updated in the search engine because of an update/insert/delete in PostgreSQL, a row gets written to this table. the primary key is on two columns, the core (index) in the Solr engine containing the entity, and the unique id of the entity.
i'm debugging the retryPush method in this case, which will run as a cron job to scavenge for updates that failed in previous attempts. so at the top of retryPush, i have this select:
queryString
= "SELECT * FROM solr_index_event WHERE status = 'RETRY ' AND core = '" + core
+ "' AND (update_type = 'ADD ' OR update_type = 'UPDATE ')"
+ " FOR UPDATE";
(i have tried this both with and without "FOR UPDATE" with no difference in behavior.)
the select is giving me the correct list of entities. subsequent selects to get the data on the specific entities are providing the correct data; the xml for the Solr update request is being built properly, and Solr is receiving the updates (via an http POST) and processing them properly.
at the very end, i need to delete the rows where the retry succeeded, and that's the method that's failing with the NPE down in the PL/Java methods.
richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20120524/61f48da8/attachment.html;
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pljava-dev@postgresql.org
Subject: Re: [Pljava-dev] null pointer exception in pl/java jdbc driver
In-Reply-To: <C35FDD5FDF7E584991A6AAF8F1A8425F0226AD50@ltischx01.lti.int>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox