agora inbox for pljava-dev@postgresql.org
help / color / mirror / Atom feedSubject: [Pljava-dev] closing jdbc connections within pljava calls
Date: Tue, 11 Apr 2006 22:30:18 +0200
Message-ID: <443C11DA.6070502@tada.se> (raw)
In-Reply-To: <6992E470F12A444BB787B5C937B9D4DF03EF4586@ca-mail1.cis.local>
References: <6992E470F12A444BB787B5C937B9D4DF03EF4586@ca-mail1.cis.local>
Hi Sriram,
The JVM will not terminate until your session terminates and the fact
that the connection remains opened will be harmless. You will waste
resources at worst since the backend process that sits at the end of
that connection remains alive until the connection is closed. My guess
is that this "waste" is a good thing since you don't need to reestablish
the connection in case you call your plpgsql function repeatedly.
I'm not 100% sure what happens to the backend process at the other end
of your connection when the JVM terminates. My guess is that it will
terminate gracefully when it senses that the socket is closed. But you
will not have a transaction active when that happens anyway so it
shouldn't matter much.
Regards,
Thomas Hallgren
Sriram Dandapani wrote:
>
> Hi
>
> I am implementing autonomous transactions by making a pljava call?and
> within the java function, I obtain a jdbc connection using the
> postgresql driver.
>
> During a regular plpgsql function call, several calls are made to this
> java function.
>
> Should I close the jdbc connection when the plgsql function
> terminates..or does the fact that the jvm is terminated sufficient ?
> What is the impact of not closing the jdbc connection ? The reason I
> ask is because an error could cause the plpsql function to terminate
> abnormally.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Pljava-dev mailing list
> Pljava-dev at gborg.postgresql.org
> http://gborg.postgresql.org/mailman/listinfo/pljava-dev
>
view thread (2+ messages)
Message-ID: <443C11DA.6070502@tada.se>
Permalink: ../443C11DA.6070502@tada.se/
Also on: postgresql.org/message-id/443C11DA.6070502@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] closing jdbc connections within pljava calls
In-Reply-To: <443C11DA.6070502@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