[Pljava-dev] Is it safe to use multi-threaded PL/Java in single-threaded postgres process?

From: maumau307 at gmail(dot)com (MauMau)
To:
Subject: [Pljava-dev] Is it safe to use multi-threaded PL/Java in single-threaded postgres process?
Date: 2014-04-13 22:28:58
Message-ID: 1F2A8D3FBCC3447391A3520631ACBD25@maumau
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

From: "Thomas Hallgren" <thomas at tada.se>
> Interesting. What does your call into PL/Java (i.e. the function) look
> like? How often do you call it (I assume just once)?

Thank you for your response. I did:

1. Compiled BatchPL.java with JDK6, then ran "jar cf batch.jar
BatchPL.class".

2. Register the jar file with:
SELECT sqlj.install_jar('file:///some/dir/batch.jar', 'batch', false);

3. Create a Java stored function with:
CREATE FUNCTION batch(integer) RETURNS void
AS 'BatchPL'
LANGUAGE java;

4. Run "SELECT batch(10000);" from psql.

So, I understand that the number of calls from the Java function to PL/Java
is 10000. I hoped PL/Java reduces the function execution time dramatically
(by half or more) to make my colleagues get interested in PL/Java.

Regards
MauMau

In response to

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Thomas Hallgren 2014-04-14 09:46:21 [Pljava-dev] Is it safe to use multi-threaded PL/Java in single-threaded postgres process?
Previous Message Thomas Hallgren 2014-04-13 14:47:54 [Pljava-dev] Is it safe to use multi-threaded PL/Java in single-threaded postgres process?