Subject: [Pljava-dev] Using JDBC in PL/Java 1.4.0: Statement.executeQuery() automatically closes the statement redux

From: tim.clarke at manifest.co.uk (Tim Clarke)
Date: Sun, 07 Mar 2010 19:33:00 +0000

I've been tracking down a problem where checking getWarnings() after an
executeQuery() in pljava and found an exchange on the list from 2008
that matches my symptoms exactly:

http://pgfoundry.org/pipermail/pljava-dev/2008/001298.html
<http://pgfoundry.org/pipermail/pljava-dev/2008/001303.html>

Kris Jurka replied swiftly and fixed the issue in the source tree. Was
this ever released live? I've just downloaded the latest:

http://pgfoundry.org/frs/download.php/1597/pljava-i686-pc-linux-gnu-pg8.2-1.4.0.tar.gz

To run against our PG 8.2.15 database and I'm still getting the problem.

-- 
Tim Clarke AMBCS MIAP
IT Director
Manifest
9 Freebournes Court
Newland Street
Witham, Essex
CM8 2BL
England
 
Phone: +44 1376 503500
Direct: +44 1376 504510
Fax: +44 1376 503550
Email: tim.clarke at manifest.co.uk <mailto:tim.clarke at manifest.co.uk>
Web: http://www.manifest.co.uk
Skype: callto:tim.clarke

Manifest is the trading name of: Manifest Information Services Ltd: Registered in England Number 3401145 & The Manifest Voting Agency Ltd:
Registered in England Number 2920820. Registered Office at above address. VAT Registration Number: GB 700 1880 77
Copyright: This e-mail may contain confidential or legally privileged information.
If you are not the named addressee you must not use or disclose such information, instead please report it to: admin at manifest.co.uk 
Please see http://www.manifest.co.uk/legal/legal_notices.htm for further information.

---

From: tim.clarke at manifest.co.uk (Tim Clarke)
Date: Fri, 12 Mar 2010 13:35:45 +0000

> To run against our PG 8.2.15 database and I'm still getting the problem.

I (think) I've managed to get a compile now using Eclipse and jdk1.5_10.
Unfortunately when registering my java function calls using

set search_path=voting;

select sqlj.install_jar('file:///usr/local/manifest/vote.jar',
  'vote', false);
select sqlj.install_jar('file:///usr/share/java/log4j.jar',
  'log4j', false);
SELECT sqlj.set_classpath('voting', 'vote:log4j');

CREATE or replace FUNCTION vote(AccountID int8, CapitalID int8,
  EventID int8, CanCopy bool, CopyFromEventID int8)
  RETURNS varchar
  AS 'uk.co.manifest.postgres.vote.VoteCalc.vote(long, long, long,
boolean, long)'
  volatile LANGUAGE java;

I get the error:

java.lang.NoSuchMethodError: Method org.postgresql.pljava.internal.Portal._
fetch(JZI)I

on that first install_jar() call followed by "failed to create JVM" on
any subsequent calls :-/ I've not found an answer by googling. Can
anyone help?

-- 
Tim Clarke AMBCS MIAP
IT Director
Manifest
9 Freebournes Court
Newland Street
Witham, Essex
CM8 2BL
England
 
Phone: +44 1376 503500
Direct: +44 1376 504510
Fax: +44 1376 503550

---

From: tim.clarke at manifest.co.uk (Tim Clarke)
Date: Mon, 22 Mar 2010 12:29:07 +0000

> any subsequent calls :-/ I've not found an answer by googling. Can

Just for the record (the list's a bit quiet ;-) :

The answer was that the version of the pljava.so file was out of step. I
ran make from command line instead of trying to export from eclipse;
obviously that did not build the C object. I found the correct version
in the folder tree after running make at the command line.

-- 
Tim Clarke AMBCS MIAP
IT Director
Manifest
9 Freebournes Court
Newland Street
Witham, Essex
CM8 2BL
England
 
Phone: +44 1376 503500
Direct: +44 1376 504510
Fax: +44 1376 503550