From pierce@hogranch.com Mon Jul 6 18:17:01 2026 From: John R Pierce Message-ID: <56B253DA.2090003@hogranch.com> Date: Wed, 3 Feb 2016 11:24:10 -0800 MIME-Version: 1.0 Subject: [Pljava-dev] odd error with 1.5.0-snapshot Content-Type: multipart/mixed; boundary="===============2662980216476798469==" This is a multi-part message in MIME format. --===============2662980216476798469== Content-Type: multipart/alternative; boundary="------------070506040109090505010506" This is a multi-part message in MIME format. --------------070506040109090505010506 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit I built 1.5.0-snapshot about 2 weeks ago, it passed the tests, so I handed it off to my production folks. Now, I do NOT currently have source to the pljava module they are trying to deploy, but they just reported to me late last night that they got this error. All I know is their app uses jdbc to connect to an oracle database on another system and updates local 'static tables' from the master copy on said oracle. I've asked to see the source, if I get it, I'll try and drilll in to see whats going on in the code referenced in the traceback below, but I'm curious if you have any hints about what that SQLException means. database=> select jdblink_version(); ERROR: 03 Feb 16 16:27:28 jdblink.core.Jdblink null java.sql.SQLException: An attempt was made to call a PostgreSQL backend function after an elog(ERROR) had been issued at org.postgresql.pljava. internal.Oid._forSqlType(Native Method) at org.postgresql.pljava.internal.Oid.forSqlType(Oid.java:74) at org.postgresql.pljava.jdbc.SPIPreparedStatement.setObject(SPIPreparedStatement.java:206) at org.postgresql.pljava.jdbc.SPIPreparedStatement.setString(SPIPreparedStatement.java:137) at jdblink.dao.JdblinkMapDAOImpl.find(JdblinkMapDAOImpl.java:84) at jdblink.core.Jdblink.getJdblinkMap(Jdblink.java:78) at jdblink.core.Jdblink.init(Jdblink.java:72) at jdblink.core.Jdblink.(Jdblink.java:64) at jdblink.core.PlJdblink.(PlJdblink.java:37) at jdblink.core.PlJdblink.getInstance(PlJdblink.java:24) at jdblink.core.JdblinkFactoryImpl.getPlJdblink(JdblinkFactoryImpl.java:16) at jdblink.postgres.Session.jdblink_version(Session.java:53) if it matters, this is CentOS 6.7, PostgreSQL 9.4.5 from the yum.postgresql.org repo, and OpenJDK 1.8.0 from the CentOS repository, all 64 bit. -- john r pierce, recycling bits in santa cruz --------------070506040109090505010506 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit I built 1.5.0-snapshot about 2 weeks ago, it passed the tests, so I handed it off to my production folks.  Now, I do NOT currently have source to the pljava module they are trying to deploy, but they just reported to me late last night that they got this error.   All I know is their app uses jdbc to connect to an oracle database on another system and updates local 'static tables' from the master copy on said oracle.   I've asked to see the source, if I get it, I'll try and drilll in to see whats going on in the code referenced in the traceback below, but I'm curious if you have any hints about what that SQLException means.

database=> select jdblink_version();
ERROR:  03 Feb 16 16:27:28 jdblink.core.Jdblink null
java.sql.SQLException: An attempt was made to call a PostgreSQL backend function after an elog(ERROR) had been issued
        at org.postgresql.pljava.
internal.Oid._forSqlType(Native Method)
        at org.postgresql.pljava.internal.Oid.forSqlType(Oid.java:74)
        at org.postgresql.pljava.jdbc.SPIPreparedStatement.setObject(SPIPreparedStatement.java:206)
        at org.postgresql.pljava.jdbc.SPIPreparedStatement.setString(SPIPreparedStatement.java:137)
        at jdblink.dao.JdblinkMapDAOImpl.find(JdblinkMapDAOImpl.java:84)
        at jdblink.core.Jdblink.getJdblinkMap(Jdblink.java:78)
        at jdblink.core.Jdblink.init(Jdblink.java:72)
        at jdblink.core.Jdblink.<init>(Jdblink.java:64)
        at jdblink.core.PlJdblink.<init>(PlJdblink.java:37)
        at jdblink.core.PlJdblink.getInstance(PlJdblink.java:24)
        at jdblink.core.JdblinkFactoryImpl.getPlJdblink(JdblinkFactoryImpl.java:16)
        at jdblink.postgres.Session.jdblink_version(Session.java:53)

if it matters, this is CentOS 6.7, PostgreSQL 9.4.5 from the yum.postgresql.org repo, and OpenJDK 1.8.0 from the CentOS repository, all 64 bit.


-- 
john r pierce, recycling bits in santa cruz
--------------070506040109090505010506-- --===============2662980216476798469== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Pljava-dev mailing list Pljava-dev@lists.pgfoundry.org http://lists.pgfoundry.org/mailman/listinfo/pljava-dev --===============2662980216476798469==-- From chap@anastigmatix.net Mon Jul 6 18:17:01 2026 References: <56B253DA.2090003@hogranch.com> From: Chapman Flack Message-ID: <56B26010.2010207@anastigmatix.net> Date: Wed, 3 Feb 2016 15:16:16 -0500 MIME-Version: 1.0 In-Reply-To: <56B253DA.2090003@hogranch.com> Subject: Re: [Pljava-dev] odd error with 1.5.0-snapshot Content-Type: text/plain; charset="us-ascii" On 02/03/2016 02:24 PM, John R Pierce wrote: > curious if you have any hints about what that SQLException means. > java.sql.SQLException: An attempt was made to call a PostgreSQL > backend function after an elog(ERROR) had been issued Ok, what it ostensibly means is: the code had, in the past, made some call into PostgreSQL that ereport()ed an ERROR. That turns into an SQLException in PL/Java (not the one we're looking at here, this had to have happened earlier). Perhaps the code had a try/catch block and caught that exception, and now it wants to proceed and do more stuff. Trouble is, whenever an ERROR has been thrown from a call into PostgreSQL, we don't know what possibly gronkled state the transaction has been left in, and for the remainder of this PL/Java function call, no more access to PostgreSQL is going to be allowed. That's what produced *this* SQLException, at the point where the code seems to be going ahead and setting a parameter in a prepared statement. If you are writing PL/Java code that does want to catch an exception thrown from PostgreSQL, recover and proceed to do more stuff, there is one way to do that. You have to use sp = conn.setSavepoint() in advance of where the exception might be thrown, and conn.releaseSavepoint(sp) in the normal case where your call is successful. In the catch block if an exception has been thrown, use conn.rollback(sp) to put the transaction back into a known non-gronkled state and now you can proceed to make more calls. That was the official answer. A different interesting question might be, what was the earlier exception that had been thrown and caught, and why was it thrown in this case if the same code had been in use before? They might want to redo the test with client_min_messages or log_min_messages (or both) set to DEBUG2 or higher. -Chap _______________________________________________ Pljava-dev mailing list Pljava-dev@lists.pgfoundry.org http://lists.pgfoundry.org/mailman/listinfo/pljava-dev From foli@numen.mg Mon Jul 6 18:17:01 2026 From: =?iso-8859-1?Q?Fr=E9d=E9ric_OLIVIE?= Subject: RE: [Pljava-dev] odd error with 1.5.0-snapshot Date: Wed, 3 Feb 2016 21:38:03 +0000 Message-ID: <87BCAED9D163094EA3086C10FB734504A9E9F892@srvmail22.numen.mg> References: <56B253DA.2090003@hogranch.com> <56B26010.2010207@anastigmatix.net> In-Reply-To: <56B26010.2010207@anastigmatix.net> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Whatever is the offical answer by distrib maintainers, Jos=E9's question se= ems very legit. While you guys are struggling for PL/Java to be integrated in distribs, "we= " are losing sysadmins which have a harder time every day to justify that t= he project is still alive. Why ? Because they have to spend an awful lot of time making it work on new= releases of PG. Guys ! Do you have any idea how "alien" it is to set up a proper maven/comp= iler environment when you're not a field proven developer ? More even under= Windows ? Why do "we" not at least offer binaries for Windows/Linux, 32/64. Having ha= d to build PL/Java by the past, I don't think I remember there's any extern= al dependency apart from the PG version. But if I'm wrong, then let's just = build the .so/.dll static ! To conclude, as far as I understand it, Jos=E9's request means that, the lo= nger there is no binaries available, the more the user base will shrink wit= h doubts regarding the long term legitimacy of this project. Which is total= ly unfair in view of you guys amazing (and successful) job to give it a sec= ond breath ! Just my 2cts anyways. Fr=E9d=E9ric. -----Message d'origine----- De=A0: Pljava-dev [mailto:pljava-dev-bounces@lists.pgfoundry.org] De la par= t de Chapman Flack Envoy=E9=A0: mercredi 3 f=E9vrier 2016 23:16 =C0=A0: pljava-dev@lists.pgfoundry.org Objet=A0: Re: [Pljava-dev] odd error with 1.5.0-snapshot On 02/03/2016 02:24 PM, John R Pierce wrote: > curious if you have any hints about what that SQLException means. > java.sql.SQLException: An attempt was made to call a PostgreSQL=20 > backend function after an elog(ERROR) had been issued Ok, what it ostensibly means is: the code had, in the past, made some call = into PostgreSQL that ereport()ed an ERROR. That turns into an SQLException = in PL/Java (not the one we're looking at here, this had to have happened ea= rlier). Perhaps the code had a try/catch block and caught that exception, = and now it wants to proceed and do more stuff. Trouble is, whenever an ERROR has been thrown from a call into PostgreSQL, = we don't know what possibly gronkled state the transaction has been left in= , and for the remainder of this PL/Java function call, no more access to Po= stgreSQL is going to be allowed. That's what produced *this* SQLException, at the point where the code seems= to be going ahead and setting a parameter in a prepared statement. If you are writing PL/Java code that does want to catch an exception thrown= from PostgreSQL, recover and proceed to do more stuff, there is one way to= do that. You have to use sp =3D conn.setSavepoint() in advance of where th= e exception might be thrown, and conn.releaseSavepoint(sp) in the normal case where your call is successful.= In the catch block if an exception has been thrown, use conn.rollback(sp) = to put the transaction back into a known non-gronkled state and now you can= proceed to make more calls. That was the official answer. A different interesting question might be, wh= at was the earlier exception that had been thrown and caught, and why was i= t thrown in this case if the same code had been in use before? They might = want to redo the test with client_min_messages or log_min_messages (or both= ) set to DEBUG2 or higher. -Chap _______________________________________________ Pljava-dev mailing list Pljava-dev@lists.pgfoundry.org http://lists.pgfoundry.org/mailman/listinfo/pljava-dev From pierce@hogranch.com Mon Jul 6 18:17:01 2026 References: <56B253DA.2090003@hogranch.com> <56B26010.2010207@anastigmatix.net> From: John R Pierce Message-ID: <56B27E4B.50800@hogranch.com> Date: Wed, 3 Feb 2016 14:25:15 -0800 MIME-Version: 1.0 In-Reply-To: <56B26010.2010207@anastigmatix.net> Subject: Re: [Pljava-dev] odd error with 1.5.0-snapshot Content-Type: text/plain; charset="us-ascii"; Format="flowed" On 2/3/2016 12:16 PM, Chapman Flack wrote: > That was the official answer. A different interesting question > might be, what was the earlier exception that had been thrown and > caught, and why was it thrown in this case if the same code had > been in use before? They might want to redo the test with > client_min_messages or log_min_messages (or both) set to DEBUG2 > or higher. thanks, Chapman... That clarified and solidified what I was guessing. It will likely take me a day or two to get access to the postgres logs as well as source code so I can try and figure out the details. 14 hour time zone differences, sigh. -- john r pierce, recycling bits in santa cruz _______________________________________________ Pljava-dev mailing list Pljava-dev@lists.pgfoundry.org http://lists.pgfoundry.org/mailman/listinfo/pljava-dev From chap@anastigmatix.net Mon Jul 6 18:17:01 2026 Message-ID: <56B2ADDF.6090401@anastigmatix.net> Date: Wed, 03 Feb 2016 20:48:15 -0500 From: Chapman Flack MIME-Version: 1.0 References: <56B253DA.2090003@hogranch.com> <56B26010.2010207@anastigmatix.net> <87BCAED9D163094EA3086C10FB734504A9E9F892@srvmail22.numen.mg> In-Reply-To: <87BCAED9D163094EA3086C10FB734504A9E9F892@srvmail22.numen.mg> Subject: Re: [Pljava-dev] odd error with 1.5.0-snapshot Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable On 02/03/16 16:38, Fr=E9d=E9ric OLIVIE wrote: > Whatever is the offical answer by distrib maintainers, Jos=E9's > question seems very legit. If I'm reading this right, you have replied to John's message about a use-after-error exception (the only place I remember saying anything about "official"), but you are mostly interested in improving the availability of prebuilt binaries. I agree, Jos=E9's question is completely legit. Prebuilt binaries simplify setting up PL/Java, and ideally, those should be easy to get. > While you guys are struggling for PL/Java to be integrated in distribs, As you saw in John's earlier message (the one where he was replying to Jos=E9), 'struggling' might be too strong a word. Devrim is ready to have prebuilt binaries for you, at least for every Linux flavor that uses rpm, just as soon as we have an official release. That's one short beta period away. The same ought to be true for the linux flavors using apt, though I think Devrim is not part of that team and I'll probably have to send a ping there myself to make sure they know the release is coming up. Ok, Windows and OS X. Those are not really my element. I am trying to absorb information here about what will be considered a convenient way to install on those platforms. The postgresql.org download page plugs the EnterpriseDB graphical installer for both of those platforms, and it (IIUC) comes with a thing called StackBuilder to automate the installation of known extensions. I think Dave Page is the person I need to contact about what's needed for StackBuilder to know about PL/Java 1.5.0. > Which is totally unfair in view of you guys amazing (and successful) job > to give it a second breath ! This is my favorite part of your message, and I am glad that you think the progress has been significant and notable. To keep a project vigorous, you do need easy availability, and you also need enough advancement in function to keep people interested. The advancement part I think we have, and the easy-availability part still has some catching up to do. I think that was the necessary order, because to keep the workload manageable, some of the work has to be done by different people. There are already people like Devrim with the infrastructure set up to build packages and they're good at it, and the packages they build will be most easily accepted by cautious sysadmins because they will be from a known repo with a recognized signing key. And for that to happen, the main requirement is to provide a package worth building. Have you tried the beta yet? :) Thanks, -Chap _______________________________________________ Pljava-dev mailing list Pljava-dev@lists.pgfoundry.org http://lists.pgfoundry.org/mailman/listinfo/pljava-dev From chap@anastigmatix.net Mon Jul 6 18:17:01 2026 Message-ID: <56BE8B02.6010609@anastigmatix.net> Date: Fri, 12 Feb 2016 20:46:42 -0500 From: Chapman Flack MIME-Version: 1.0 References: <56B253DA.2090003@hogranch.com> <56B26010.2010207@anastigmatix.net> <87BCAED9D163094EA3086C10FB734504A9E9F892@srvmail22.numen.mg> <56B2ADDF.6090401@anastigmatix.net> In-Reply-To: <56B2ADDF.6090401@anastigmatix.net> Subject: Re: [Pljava-dev] odd error with 1.5.0-snapshot Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable On 02/03/16 20:48, Chapman Flack wrote: > As you saw in John's earlier message (the one where he was replying to > Jos=E9), 'struggling' might be too strong a word. Devrim is ready to have > prebuilt binaries for you, at least for every Linux flavor that uses rpm, > just as soon as we have an official release. That's one short beta period > away. > = > The same ought to be true for the linux flavors using apt, though I think > Devrim is not part of that team and I'll probably have to send a ping > there myself to make sure they know the release is coming up. I've contacted Christoph Berg about .deb packaging. He is looking into it but there's an extra complication in this case ... the Debian philosophy and its possible conflict with how Maven builds things. Who knew? I didn't. Christoph is continuing to seek a solution. > Ok, Windows and OS X. Those are not really my element. I am trying > to absorb information here about what will be considered a convenient > way to install on those platforms. The postgresql.org download page > plugs the EnterpriseDB graphical installer for both of those platforms, > and it (IIUC) comes with a thing called StackBuilder to automate the > installation of known extensions. I think Dave Page is the person I > need to contact about what's needed for StackBuilder to know about > PL/Java 1.5.0. I reached Dave, and essentially StackBuilder will add our installer to its list and invoke it with options selected, but providing and building said installer would be PL/Java's job. That'll take making buildfarm arrangements somewhere to do official MSVC and OS X builds, and developing a more traditional does-it-all-for-you style of installer, perhaps built on something like IzPack. Short of that, it would be nice to see about at least getting a Homebrew formula and MacPorts port, as options for OS X sites, especially as El Capitan dropping the openssl headers made the source build more fiddly. -Chap _______________________________________________ Pljava-dev mailing list Pljava-dev@lists.pgfoundry.org http://lists.pgfoundry.org/mailman/listinfo/pljava-dev From pierce@hogranch.com Mon Jul 6 18:17:01 2026 References: <56B253DA.2090003@hogranch.com> <56B26010.2010207@anastigmatix.net> <87BCAED9D163094EA3086C10FB734504A9E9F892@srvmail22.numen.mg> <56B2ADDF.6090401@anastigmatix.net> <56BE8B02.6010609@anastigmatix.net> From: John R Pierce Message-ID: <56BED672.1060108@hogranch.com> Date: Fri, 12 Feb 2016 23:08:34 -0800 MIME-Version: 1.0 In-Reply-To: <56BE8B02.6010609@anastigmatix.net> Subject: Re: [Pljava-dev] odd error with 1.5.0-snapshot Content-Type: text/plain; charset="us-ascii"; Format="flowed" On 2/12/2016 5:46 PM, Chapman Flack wrote: > I reached Dave, and essentially StackBuilder will add our installer to > its list and invoke it with options selected, but providing and building > said installer would be PL/Java's job. That'll take making buildfarm > arrangements somewhere to do official MSVC and OS X builds, and developing > a more traditional does-it-all-for-you style of installer, perhaps > built on something like IzPack. cool. I see there is a maven for windows, thats a good start :) https://maven.apache.org/guides/getting-started/windows-prerequisites.html I guess you'll need to deal with the free visualC compiler commands for the C bit to build. there is a free MS VisualC++ command line compiler buried in this IDE package, which should build dll's compatible with the eDB postgres binaries.... https://www.visualstudio.com/products/visual-studio-community-vs I'm surprised stackbuilder doesn't have some simple built-in way to copy a few files? the native Windows method of installing stuff is to package it as a .msi file. I remembering having to wade pretty deep to get those working. freeware msi builder of possible interest: http://scalablesmartpackager.com/smart-packager-ce-free-msi-packager/ -- john r pierce, twisting bits in santa cruz _______________________________________________ Pljava-dev mailing list Pljava-dev@lists.pgfoundry.org http://lists.pgfoundry.org/mailman/listinfo/pljava-dev