Re: DataSource.setMaxConnections() - Does not work - Mailing list pgsql-jdbc

From J. W. Ulbts
Subject Re: DataSource.setMaxConnections() - Does not work
Date
Msg-id 930265164@web.de
Whole thread Raw
In response to DataSource.setMaxConnections() - Does not work  (Michael Andreasen <michael@dunlops.com>)
List pgsql-jdbc
Hi Michael,

I'm sure your assumption is not correct.
The application uses the maximum of 3 connections but every other application also accessing PostgreSQL needs at least
oneconnection (e.g. pgAdmin,...), so you see >3 connections to the server. 
It's also possible that there is an error in the code so not only the datasource you defined is used.
You might want to replace the driver with 8.4 Build 701. I'm using that driver myself with a max connection setting.

Testing it is very easy...just try to open more connections then possible. You will see that the application "hangs" if
youtry to open connection number 4. 

--
Kind regards,
Juergen Ulbts


> -----Ursprüngliche Nachricht-----
> Von: "Michael Andreasen" <michael@dunlops.com>
> Gesendet: 26.09.09 15:35:28
> An: pgsql-jdbc@postgresql.org
> Betreff: Re: [JDBC] DataSource.setMaxConnections() - Does not work

Even though I set it at 3, if I look on the server I can see many
> more connections have been made?
>
> On Sat, Sep 26, 2009 at 2:25 PM, Michael Andreasen <michael@dunlops.
> com> wrote:
> Hi,
>
> Using version: 8.3-605.jdbc3
>
> DataSource.setMaxConnections() does not work.
>
> I create my datasource as such;
> dataSource = new PGPoolingDataSource();
>  dataSource.setServerName("10.44.73.50");
>  dataSource.setDatabaseName("ops");
>  dataSource.setUser("postgres");
>  dataSource.setPassword("postgres");
>  dataSource.setMaxConnections(3);
>
> --
> Regards,
> Michael Andreasen
> Senior Analyst / Developer
>
> --
> Regards,
> Michael Andreasen
> Senior Analyst / Developer
>
>


________________________________________________________________
Neu: WEB.DE Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://produkte.web.de/go/02/


pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Wrong column default values
Next
From: Eric Jain
Date:
Subject: Compression