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