agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] pljava reninitializing jdbc connection pool for every	invocation
Date: Tue, 21 Mar 2006 19:37:24 +0100
Message-ID: <442047E4.2020707@tada.se> (raw)
In-Reply-To: <6992E470F12A444BB787B5C937B9D4DF03C48AF8@ca-mail1.cis.local>
References: <6992E470F12A444BB787B5C937B9D4DF03C48AF8@ca-mail1.cis.local>

Sriram Dandapani wrote:
> Ok..the picture is getting clearer.. This is what we do
>
> The java method that is called using pljava obtains a jdbc connection
> using the postgresql driver because we need the autonomous transaction
> feature.
>
> When a postgres function calls this pljava function, every invocation
> results in a new connection being obtained. Since we do not use
> pljava.jar to obtain this connection, am I losing out on the nice
> in-process features you mentioned. 
>
>   

Well, you can never have autonomous transactions in-process when you use 
PostgreSQL. But there's no need for you to create a new remote 
connection for each and every invocation. Let it be created in your 
first call. Store it in a static variable and reuse it on all subsequent 
calls. Make sure each call performs a commit or rollback on it but don't 
close it.

Regards,
Thomas Hallgren





view thread (5+ messages)

Message-ID: <442047E4.2020707@tada.se>
Permalink:  ../442047E4.2020707@tada.se/
Also on:    postgresql.org/message-id/442047E4.2020707@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] pljava reninitializing jdbc connection pool for every	invocation
  In-Reply-To: <442047E4.2020707@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