[Pljava-dev] pljava reninitializing jdbc connection pool for every invocation
Thomas Hallgren
thomas at tada.se
Tue Mar 21 18:37:24 UTC 2006
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
More information about the Pljava-dev
mailing list