agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] Again multithreading
Date: Thu, 23 Feb 2006 08:58:46 +0100
Message-ID: <43FD6B36.1030104@tada.se> (raw)
In-Reply-To: <803736063@web.de>
References: <803736063@web.de>

Patrick Peisker wrote:
> (1) PL/Java uses one JVM per connection. Run the PL/Java trigger functions in one "main" JVM or run the functions in the JVM of the actuator (e.g. a JDBC connection unsing the SQL-statement 'insert')?
>
>   
The trigger will be executed in the JVM that becomes embedded in the 
PostgreSQL backend process that represents the connection. PostgreSQL 
spawns a new process for each connection that is opened. The JVM becomes 
part of that process.
> (2) What happens to a thread if it is created in a JVM of an conncetion and the connection is closed?
>
>   
When the connection is closed, the PostgreSQL backend process terminates 
and since the JVM is embedded, it terminates too, in a controlled manner.

> (3) Referring to my first mail about multihreading, is there any chance to ensure that a thread is called again from the backend?
>
>   
No, not unless you do it yourself. If you issue a function call to a 
Java function and let that function sleep for a short period of time, 
other threads that are waiting to use the backend will be released.

Kind Regards,
Thomas Hallgren





view thread (3+ messages)

Message-ID: <43FD6B36.1030104@tada.se>
Permalink:  ../43FD6B36.1030104@tada.se/
Also on:    postgresql.org/message-id/43FD6B36.1030104@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] Again multithreading
  In-Reply-To: <43FD6B36.1030104@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