[Pljava-dev] null pointer exception in pl/java jdbc driver

From: rwelty at ltionline(dot)com (Welty, Richard)
To:
Subject: [Pljava-dev] null pointer exception in pl/java jdbc driver
Date: 2012-05-24 13:44:21
Message-ID: C35FDD5FDF7E584991A6AAF8F1A8425F0226AD50@ltischx01.lti.int
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

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>

In response to

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Johann 'Myrkraverk' Oskarsson 2012-05-24 14:46:33 [Pljava-dev] null pointer exception in pl/java jdbc driver
Previous Message Johann 'Myrkraverk' Oskarsson 2012-05-24 09:07:43 [Pljava-dev] null pointer exception in pl/java jdbc driver