artifact_id;status_id;status_name;priority;submitter_id;submitter_name;assigned_to_id;assigned_to_name;open_date;close_date;last_modified_date;summary;details;"Category";"Group"
1010223;1;"Open";3;107543;"Lucas Madar";100;"Nobody";"2008-01-06 10:10";"";"2012-09-24 02:14";"Using Savepoints does not work with the ResultSet interface";"If you have a complicated function that uses the ResultSet interface, PL/Java does not work correctly. Instead, an error is returned indicating that TopTransaction is not the owner of of a resource.

This is due to PL/Java not keeping track of memory context and resource owner information when using internal postgresql functions. I have a patch that seems to resolve this issue. However, I do not claim to be an expert; I figured this out by looking at the code and noticing that some of these functions can change the current context or resource owner.

";"None";"None"
1010658;1;"Open";3;5540;"Kris Jurka";100;"Nobody";"2009-06-17 23:11";"";"2012-09-24 02:14";"parallel build fails";"As reported privately by Nathan Egge, pljava doesn't build successfully if invoked with make -jN.  There is no dependency requiring the javah process to complete before trying to build the source code.";"None";"None"
1010962;1;"Open";3;177752;"Johann Oskarsson";177752;"Johann Oskarsson";"2010-12-15 17:07";"";"2012-09-24 02:14";"TupleDesc reference leak";"The following causes quite a few TupleDesc reference leak warnings.

create type B as ( b1_val float8, b2_val int);
create type C as ( c1_val float8, c2_val float8);

-- create complex, nested type
create type complexA as (
       b B,
       c C,
       a_val int);

// File ComplexTest.java
package com.myrkraverk;

import java.sql.Array;
import java.sql.ResultSet;
import java.sql.SQLException;

public class ComplexTest
{
    public static int complexParam( ResultSet receiver[] )
	throws SQLException
    {
	for ( int i = 0; i < receiver.length; i++ )
	    {
		ResultSet b = (ResultSet)receiver[ i ].getObject( 1 );
		double b_val = b.getDouble( 1 );
		int b2_val = b.getInt( 2 );

		ResultSet c = (ResultSet)receiver[ i ].getObject( 2 );
		double c1_val = c.getDouble( 1 );
		double c2_val = c.getDouble( 2 );
		
		int a = receiver[ i ].getInt( 3 );
		;
	    }

	return 0;
    }
}
// End of file: ComplexTest.java

create function complexParam( complexA[] ) returns int
as 'com.myrkraverk.ComplexTest.complexParam'
language java;

select complexParam(array_agg(((0.1,i)::B,(0.1,10/i)::C,i)::complexA))  from
generate_series (1,10) i;

-- This generates lots of warnings like:

WARNING:  TupleDesc reference leak: TupleDesc 124e120 (139824,-1) still referenced";"PL/Java";"1.4.2"
1011095;1;"Open";3;405283;"chris vorarlberger";100;"Nobody";"2011-09-24 06:51";"";"2012-09-24 02:14";"SSLSocketFactory throws IOException on Linux";"With reference to this thread, I would like to file a bug: http://postgresql.1045698.n5.nabble.com/Strange-error-on-linux-but-not-on-windows-td4818296.html 

To reproduce the issue please compile this small java code:
package net.sourceforge.pgbsh;

import java.io.*;
import javax.net.ssl.*;

public class Test {   
    public static boolean testSSL() throws IOException    {
        int port = 443;
        String hostName = ""www.sun.com"" ;
       
        SSLSocketFactory sslFact = (SSLSocketFactory) SSLSocketFactory.getDefault ();
        SSLSocket socket = (SSLSocket) sslFact.createSocket(hostName, port);
        InputStream in = socket . getInputStream ();
        OutputStream out = socket . getOutputStream ();
       
        // la la la ...
       
        in.close ();
        out.close ();
       
        return true;
    }

    public static void main(String[] args) throws IOException    {
       boolean useless = testSSL();
    }    
}

And create the corresponding SQL function:
CREATE OR REPLACE FUNCTION test_ssl()
     RETURNS boolean
     AS 'net.sourceforge.pgbsh.Test.testSSL'
     LANGUAGE javau;


If you want to execute the sql code on a linux host, you will catch an IOException:

postgres@ubuntu:~$  psql -Upostgres -c ""select test_SSL();""
ERROR:  java.io.IOException


But you can successfully execute the sql on windows:

D:\> psql -Upostgres -c ""select test_SSL();""
 test_ssl
----------
 t
(1 Zeile)


Finally, you can also successfully execute from a standard linux console:

postgres@ubuntu:~/pgnetted/pgnetted-svn/PgNetted/PgBsh$ java -cp ""lib/bsh-2.1b2.jar:lib/pljava.jar:lib/postgresql-8.4-702.jdbc4.jar:pgbsh.jar"" net.sourceforge.pgbsh.Test
postgres@ubuntu:~/pgnetted/pgnetted-svn/PgNetted/PgBsh$


So there must be a security constraint somewhere on linux. Could you please provide a fix or a workaround.
";"PL/Java";"None"
1011117;1;"Open";3;112268;"Christian Meier";100;"Nobody";"2011-11-13 13:01";"";"2012-09-24 02:14";"seems that try catch is powerless on prepared statements";"i am using win 7 64x, postgres 9.0.4 Java 1.6 and pljava 1.4.2 

the following code

PreparedStatement ps = DatabaseUtils.getPreparedStatement(sql.toString());
		for (int i=0;i<values.length;i++)
			ps.setObject(i+1, values[i]); //ps.setObject(i+1, values[i], (Integer) ClassUtils.TYPE_MAPPING.get(values[i].getClass())[1]);
		
		env.print(ps.toString());
		
		try {
			ps.execute(); //<--- is causing problems
		} catch (SQLException e) {
			ps.clearWarnings();
			Logger.getAnonymousLogger().warning(StackUtils.getStackTrace(e));
		} finally {
			ps.close();
		}

results in an exception:
""An attempt was made to call a PostgreSQL backend function after an elog(ERROR) had been issued""

this is because the prepared statement is violating a duplicate key. as you can see the try catch is powerless and the exception will allways result in a complete rollback.


";"None";"None"
1011181;1;"Open";3;177752;"Johann Oskarsson";177752;"Johann Oskarsson";"2012-03-30 17:59";"";"2012-09-24 02:14";"PL/Java fails to compile with -Werror=format-security";"Emailed from Christoph Berg.";"PL/Java";"CVS"
1011206;1;"Open";3;177752;"Johann Oskarsson";177752;"Johann Oskarsson";"2012-06-20 19:22";"";"2012-09-24 02:14";"The built in functions do not use the correct error codes.";"The built in functions SQLJ.INSTALL_JAR(), SQLJ.REPLACE_JAR() and SQLJ.REMOVE_JAR() do not return the correct error codes when the jar name exists or not, respectively.

According to the SQL standard part 13 JRT, SQLJ.INSTALL_JAR() should return 46002 when the jar name exists already in the database, SQLJ.REPLACE_JAR() 4600A and SQLJ.REMOVE_JAR() 4600B when it doesn't.";"PL/Java";"2.0.0"
1011217;1;"Open";3;471298;"Adam Ringel";100;"Nobody";"2012-08-07 15:01";"";"2012-09-24 02:14";"Installing examples.jar gives same error on win32 and Solaris 64";"Using  snapshot.20120525 running: 

SELECT sqlj.install_jar('file:///ttt/postgres/pljava/pljava-snapshot.20120525.0-win32/examples.jar', 'samples',  true);

gives the same error when run under Postgres 9.1.3 Win 32 (pre-built binary) and Solaris 10 64 bit (built ourselves using gcc):

ERROR:  java.sql.SQLException: No such class: org.postgresql.pljava.example.ComplexTuple

Full output:

NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index ""employees1_pkey"" for table ""employees1""
CONTEXT:  SQL statement ""CREATE TABLE javatest.employees1 ( id int PRIMARY KEY, name varchar(200), salary int )""
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index ""employees2_pkey"" for table ""employees2""
CONTEXT:  SQL statement ""CREATE TABLE javatest.employees2 ( id int PRIMARY KEY, name varchar(200), salary int, transferDay date, transferTime time )""
NOTICE:  type ""javatest.complex"" is not yet defined
DETAIL:  Creating a shell type definition.
CONTEXT:  SQL statement ""CREATE FUNCTION javatest.complexdummy(cstring) RETURNS javatest.complex AS 'lower' LANGUAGE INTERNAL""
NOTICE:  return type javatest.complex is only a shell
CONTEXT:  SQL statement ""CREATE FUNCTION complex_in(cstring) RETURNS javatest.complex AS 'UDT[org.postgresql.pljava.example.ComplexScalar] input' LANGUAGE java IMMUTABLE STRICT""
NOTICE:  argument type javatest.complex is only a shell
CONTEXT:  SQL statement ""CREATE FUNCTION complex_out(javatest.complex) RETURNS cstring AS 'UDT[org.postgresql.pljava.example.ComplexScalar] output' LANGUAGE java IMMUTABLE STRICT""
NOTICE:  return type javatest.complex is only a shell
CONTEXT:  SQL statement ""CREATE FUNCTION complex_recv(internal) RETURNS javatest.complex AS 'UDT[org.postgresql.pljava.example.ComplexScalar] receive' LANGUAGE java IMMUTABLE STRICT""
NOTICE:  argument type javatest.complex is only a shell
CONTEXT:  SQL statement ""CREATE FUNCTION complex_send(javatest.complex) RETURNS bytea AS 'UDT[org.postgresql.pljava.example.ComplexScalar] send' LANGUAGE java IMMUTABLE STRICT""
ERROR:  java.sql.SQLException: No such class: org.postgresql.pljava.example.ComplexTuple";"PL/Java";"2.0.0"
1011219;1;"Open";3;472525;"Sureeraya Limpaibul";100;"Nobody";"2012-08-25 03:09";"";"2012-09-24 02:14";"cc1: error: unrecognized command line option ""-arch"" on mac os x 10.7";"Dear Sir, 

I'm try to build pljava.so on mac os x 10.7 (lion) with gcc 4.2 java 1.5.0_30
but got this error. Please help


bash-3.2# cd pljava-1.4.3/
bash-3.2# make
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
/u01/app/pgsql/pljava/src/pljava-1.4.3/src/C/pljava/Makefile:225: warning: overriding commands for target `pljava.so'
/Library/PostgreSQL/8.4/lib/postgresql/pgxs/src/makefiles/../../src/Makefile.shlib:365: warning: ignoring old commands for target `pljava.so'
gcc -no-cpp-precomp -c -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -headerpad_max_install_names -arch ppc -arch i386 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv   -I. -I/Library/PostgreSQL/8.4/include/postgresql/server -I/Library/PostgreSQL/8.4/include/postgresql/internal -I/usr/include/libxml2  -I/usr/local/include/libxml2 -I/usr/local/include -DPKGLIBDIR=\""/Library/PostgreSQL/8.4/lib/postgresql\"" -I/u01/app/pgsql/pljava/src/pljava-1.4.3/src/C/include -I/u01/app/pgsql/pljava/src/pljava-1.4.3/build/jni -DPGSQL_MAJOR_VER=8 -DPGSQL_MINOR_VER=4 -DPGSQL_PATCH_VER=12 -I/System/Library/Frameworks/JavaVM.framework/Headers/ /u01/app/pgsql/pljava/src/pljava-1.4.3/src/C/pljava/Backend.c -o Backend.o
cc1: error: unrecognized command line option ""-arch""
cc1: error: unrecognized command line option ""-arch""
make[1]: *** [Backend.o] Error 1
make: *** [c_all] Error 2";"None";"None"