From: maumau307 at gmail.com (MauMau) Date: Mon, 14 Apr 2014 07:28:58 +0900 Subject: [Pljava-dev] Is it safe to use multi-threaded PL/Java in single-threaded postgres process? In-Reply-To: <534AA39A.4010906@tada.se> References: <30A6B4B499494CED93770BBC4835840C@maumau> <5F50DAFCABA4426FA54E9D8D0B78B38B@maumau> <534AA39A.4010906@tada.se> Message-ID: <1F2A8D3FBCC3447391A3520631ACBD25@maumau> From: "Thomas Hallgren" > 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