agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] pl/java and concurrency
Date: Sun, 29 Apr 2012 14:37:57 +0200
Message-ID: <4F9D3625.2080106@tada.se> (raw)
In-Reply-To: <C35FDD5FDF7E584991A6AAF8F1A8425F0226AD1B@ltischx01.lti.int>
References: <C35FDD5FDF7E584991A6AAF8F1A8425F0226AD1B@ltischx01.lti.int>

Hi Richard,

Each connection in PostgreSQL runs in a process of its own. It's not a 
multi threaded server architecture. This means that each connection will 
have a JVM of its own which means that there's no real concurrency.

If code inside a trigger spawns multiple threads that in turn performs 
database accesses using the internal PL/Java jdbc driver, then PL/Java 
will synchronize those calls and only allow one at a time. It has to be 
that way since they all share the same connection (and the same 
transaction).

HTH,
Thomas Hallgren


On 2012-04-29 00:02, Welty, Richard wrote:
>
> i'm looking a pl/java as a possible implementation language for a 
> trigger function.
>
> the trigger is going to need to do a couple of selects, build an xml 
> string and then issue an http request.
> it has the potential to be rather busy.
>
> i understand the reason why entry points need to be statics, but i'd 
> like to understand how pl/java
> deals with concurrency. could someone please outline how this works?
>
> the solution will be running on amazon ec2 linux instances, postgresql 
> 9.1.3. the installed jdk is
> openjdk 1.6
>
> thanks,
>    richard
>
>
>
> _______________________________________________
> Pljava-dev mailing list
> Pljava-dev at pgfoundry.org
> http://pgfoundry.org/mailman/listinfo/pljava-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20120429/28d2f474/attachment.html;



view thread (2+ messages)

Message-ID: <4F9D3625.2080106@tada.se>
Permalink:  ../4F9D3625.2080106@tada.se/
Also on:    postgresql.org/message-id/4F9D3625.2080106@tada.se

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pljava-dev@postgresql.org
  Subject: Re: [Pljava-dev] pl/java and concurrency
  In-Reply-To: <4F9D3625.2080106@tada.se>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox