Re: ConnectionPool howto?? - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: ConnectionPool howto??
Date
Msg-id 1045568235.19508.50.camel@inspiron.cramers
Whole thread Raw
In response to ConnectionPool howto??  ("Dirk Bromberg" <bromberg@tzi.de>)
List pgsql-jdbc
Dirk,

A connection pool is pretty easy to make.

Just create a class which keeps connections in a fifo linked list.

When you get a connection from the pool, first check to see if there is
on in the list, if there is then get it and return it to the caller, if
there isn't then if the number of connections is less than 30 open one
and return it to the caller.

You return connections to the pool, and place them at the tail of the
list assuming you are getting new connections from the head.

There are some other things you have to do, like close them all on a vm
shutdown, but for the most part what I have described will work just
fine


Dave

On Mon, 2003-02-17 at 15:45, Dirk Bromberg wrote:
> Hi,
>
> i'm new to postgres sql and jdbc..
>
> i want to use a connection pool with 30 connections for my application
> so now the questions:
>
> 1. where can i get a pool ?
> 2. when i've the pool and i get a connection who do i free it back to
> the pool ?
>
> thx
> Dirk Bromberg
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
--
Dave Cramer <Dave@micro-automation.net>


pgsql-jdbc by date:

Previous
From: Tom Lane
Date:
Subject: Re: [ADMIN] Leftover processes on shutdown - Debian+JDBC
Next
From: Daniel Serodio
Date:
Subject: Re: Database Instance Creation via Java/JDBC