Re: ConnectionPool howto??

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: ConnectionPool howto??
Дата
Msg-id 1045568235.19508.50.camel@inspiron.cramers
обсуждение исходный текст
Ответ на ConnectionPool howto??  ("Dirk Bromberg" <bromberg@tzi.de>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [ADMIN] Leftover processes on shutdown - Debian+JDBC
Следующее
От: Daniel Serodio
Дата:
Сообщение: Re: Database Instance Creation via Java/JDBC