Subject: [Pljava-dev] status of pl/java with current postgres and JDK ?

From: John R Pierce <[email-masked]>
Date: Mon, 7 Dec 2015 21:42:21 -0800

Its been several years since I've tried to deploy anything using pl/java 
and its rearing its ugly head again at my $job...  we have this one 
in-house component that was developed on oracle, which is known to work 
with postgres and pljava, that we need to bring up under newer currently 
supported systems in a reasonably painless process.

our platform is CentOS 6.x 64bit, we want to deploy using PostgreSQL 
9.4.latest, and would prefer to use OpenJDK supplied with the 
CentOS/RHEL, preferably java 1.7 or 1.8 as 1.6 is considered EOL.

last time I built pljava I remember having all sorts of problems with 
whatever postgres was latest at the time, as well as java.

so, my first question:  Have things been patched up so they work with 
current postgres/java ?

the deployment situation was awful too, we ended up having to deploy it 
manually and it was rather intricate, and in my $job case, this is 
particularly complex because the production systems administrators are 
in Asia, with a 9 hour time zone difference, I'm part of a US based 
development team.

I'd LOVE to see pljava packaged by pgdg as RPM's in their yum repository 
for the above versions, so deployment would be as simple as ...

     yum install postgresql94-{server,devel,contrib,pljava}

My 2nd question:   How far off is that from a possibility ?   Is this 
something that could be encouraged with a bounty or something?

-- 
john r pierce, california

_______________________________________________
Pljava-dev mailing list
[email-masked]
http://lists.pgfoundry.org/mailman/listinfo/pljava-dev

---

From: Achilleas Mantzios <[email-masked]>
Date: Tue, 8 Dec 2015 09:47:37 +0200

On 08/12/2015 07:42, John R Pierce wrote:
> Its been several years since I've tried to deploy anything using pl/java and its rearing its ugly head again at my $job...  we have this one in-house component that was developed on oracle, which is 
> known to work with postgres and pljava, that we need to bring up under newer currently supported systems in a reasonably painless process.
>
> our platform is CentOS 6.x 64bit, we want to deploy using PostgreSQL 9.4.latest, and would prefer to use OpenJDK supplied with the CentOS/RHEL, preferably java 1.7 or 1.8 as 1.6 is considered EOL.
>
> last time I built pljava I remember having all sorts of problems with whatever postgres was latest at the time, as well as java.
>
> so, my first question:  Have things been patched up so they work with current postgres/java ?
>

Now it makes/installs with maven. I did it (not so) easily on my FreeBSD, you should be ok on Linux.
Having maven compile your C is interesting :)

>
> the deployment situation was awful too, we ended up having to deploy it manually and it was rather intricate, and in my $job case, this is particularly complex because the production systems 
> administrators are in Asia, with a 9 hour time zone difference, I'm part of a US based development team.
>
> I'd LOVE to see pljava packaged by pgdg as RPM's in their yum repository for the above versions, so deployment would be as simple as ...
>
> My 2nd question:   How far off is that from a possibility ?   Is this something that could be encouraged with a bounty or something?
>

Far. The guys at pljava do their best within their limitations to have a working extension,
but I wouldn't expect anything more soon.

-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt

---

From: John R Pierce <[email-masked]>
Date: Tue, 8 Dec 2015 00:51:29 -0800

> Having maven compile your C is interesting :)

ok, I found this
https://github.com/tada/pljava/wiki/Building-pl-java

I take it this old page is out of date now with its references to JRE 
1.4.2, 1.5.0?
https://github.com/tada/pljava/wiki/Installing-on-linux-%28or-other-%2Anix%29

(hah, on that last page, I recognize those Solaris Notes from my earlier 
tinkering with this...   I think the 2nd paragraph is no longer true but 
then 8.4 hasn't been 'current' in a long time, nor has Sun been in 
existance, its all Oracle now, and I'm not sure Studio 11/12 is 
available anymore for free.)

re: getting this packaged as an RPM, maybe we can enlist Devrim's help 
as its really only 2 components that need to be put into said RPM, and 
he has the whole RPM build environment setup, now that compiling is as 
simple as it appears.

-- 
john r pierce, recycling bits in santa cruz

---

From: Chapman Flack <[email-masked]>
Date: Tue, 08 Dec 2015 08:02:36 -0500

> https://github.com/tada/pljava/wiki/Building-pl-java

You have come at a (reasonably) good time; a lot of bugs have recently
been fixed (there are a few recent pull requests fixing more), and
there is a work-in-progress branch that simplifies the installation
process considerably. It has now passed testing on Linux, Windows (MSVC)
and OS X, and will probably become a pull request later this week.
The next PR will probably be to advance the project revision in the
Maven POM to 1.5.0-SNAPSHOT.

So, depending on your exact timing requirements in $job, you might be
able to avoid wasting time struggling with the old processes.

-Chap

---

From: Achilleas Mantzios <[email-masked]>
Date: Tue, 8 Dec 2015 15:12:26 +0200

> Maven POM to 1.5.0-SNAPSHOT.

Hello,
is MS Windows/PgSQL/pljava community larger than the FreeBSD/PgSQL/pljava community?
Why is FreeBSD left out?

I am willing to help in testing, if you guys say so.

-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt

---

From: Chapman Flack <[email-masked]>
Date: Tue, 8 Dec 2015 11:36:33 -0500

> FreeBSD/PgSQL/pljava community?

Well, nobody's trying to leave BSDs out. :)  At bottom, the
newest development is known to work in Linux because that's
where it's been developed, and Windows and OS X are covered
because Ken and Daniel (respectively) tried to build from
github and reported what went wrong, and then didn't have the
sense to flee when asked "ok, how would you like to do more
git pulls and rebuilds for a week and keep reporting what's
wrong until it's right?"

You could do the same for FreeBSD if you'd like. There are
currently 4 outstanding pull requests you could try building
and see what happens.  There is a good chance you'll be as
bored as a Maytag repairman, just because between Linux and
BSDs there is nothing like the gulf separating *x and Windows,
for example.

Cheers,
-Chap

---

From: Chapman Flack <[email-masked]>
Date: Tue, 08 Dec 2015 18:18:21 -0500

On 12/08/15 11:36, Chapman Flack wrote:

> Well, nobody's trying to leave BSDs out. :)

In case my reply at lunch time seemed flip:

Certainly, if you or anyone with FreeBSD connections would like to
participate in testing, that would be very welcome.  I see that, a
couple of years ago, you identified an issue where PL/Java would
hang in FreeBSD because PostgreSQL had not been built against libpthread.

Do you know whether that was eventually fixed by the maintainer of
the port for PostgreSQL itself?  That would definitely be important to
know.

If you would like to do some testing, you could start now with the
current outstanding pull requests, or you could wait just a bit. Those
PRs are fairly mundane, small fixes. What is currently work in progress
and will be my next PR (after those four are merged) is more substantial,
aimed at resolving issues 9, 12, 61, 71, and much of the rest of
the remaining "painful to install on platform X" issues. The patch also
includes new documentation on building and installation, organized to
allow for platform-specific detail pages.

After that gets merged, though there are still some open issues, I am
inclined to propose starting the countdown to a 1.5.0 release. (A separate
fix for issue 48 should surely be included as well.)

If there's no objection to that proposal, you would then have the obvious
high-value time window to test and identify any important issues with
respect to FreeBSD before a release, and/or to contribute a FreeBSD-specific
page to the documentation if you find any special considerations that
you think should be covered there.

Also, if you have contacts on the [email-masked] port-maintainer team
(or if you are *on* that team), that could be a good time to start gauging
interest in possibly making PL/Java available in ports.

Again, I hope my earlier message didn't sound dismissive. Is this better? :)

Thanks,
-Chap

---

From: Achilleas Mantzios <[email-masked]>
Date: Wed, 9 Dec 2015 10:10:21 +0200

> BSDs there is nothing like the gulf separating *x and Windows,

When java and threads are involved, things usually get nasty,
not so sure that it will be so easy with FreeBSD.
I remember I had to tweak postgresql compilation switches to get
pljava work in pgsql 9.3/FreeBSD 9.2.

-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt

---

From: Chapman Flack <[email-masked]>
Date: Wed, 09 Dec 2015 17:49:20 -0500

> pljava work in pgsql 9.3/FreeBSD 9.2.

Ok, yes, I did find an earlier thread where you had done that.

I am pretty sure the real fix for that has to be made in the port
for postgresql itself, to make sure the functioning thread library
is linked. I do see how that could be tough to explain to the
pgsql port maintainers, who might think it isn't necessary because
pgsql itself doesn't use threads, but leaving it out will be a problem
dynamic linking from pgsql to anything else that uses threads internally,
whether Java or ???.

I'm doubtful that anything can be done on PL/Java's end to solve the
problem, if pgsql itself has been linked with a nonfunctional threads stub.
While PL/Java never lets more than one thread into postgres at a time,
Java simply does use multiple threads internally and there is no getting
around that.

With that said, it *might* be possible to have PL/Java at least test
for that situation, and give a useful error message (with an errhint
to relink postgres with the thread library) instead of just silently
hanging and making you guess. That kind of help really does improve
the installation experience, so if you know of a (preferably portable)
way to check that, it would be a valuable patch.

Cheers,
-Chap

---

From: Achilleas Mantzios <[email-masked]>
Date: Thu, 10 Dec 2015 09:51:02 +0200

> way to check that, it would be a valuable patch.

Thanx for your ideas Chap.
Next time around (next pgsql upgrade I guess), I will be more verbose in this list
and ask you guys for guidance on what/how to report/communicate/do, in order to
somehow make FreeBSD "more" official.

BTW, I personally never used packages neither on linux nor on FreeBSD,
mainly cause we need exotic features like ldap support.

-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt

---

From: Chapman Flack <[email-masked]>
Date: Mon, 14 Dec 2015 23:39:50 -0500

> pljava work in pgsql 9.3/FreeBSD 9.2.

If I look at this commit diff for FreeBSD,

https://svnweb.freebsd.org/base/head/lib/libthr/libthr.3?r1=272153&r2=278627

it makes me think things might be improved as of FreeBSD 10.2
(though I haven't tried it).

-Chap

---

From: Achilleas Mantzios <[email-masked]>
Date: Tue, 15 Dec 2015 10:18:39 +0200

> (though I haven't tried it).

Hi Chap,

thanx for the find. Will keep an eye on this.

-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt