Re: DataSource.setMaxConnections() - Does not work

From: "J(dot) W(dot) Ulbts" <magog001(at)web(dot)de>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: DataSource.setMaxConnections() - Does not work
Date: 2009-09-27 10:39:03
Message-ID: 930265164@web.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 one connection (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 you try to open connection number 4.

--
Kind regards,
Juergen Ulbts

> -----Ursprüngliche Nachricht-----
> Von: "Michael Andreasen" <michael(at)dunlops(dot)com>
> Gesendet: 26.09.09 15:35:28
> An: pgsql-jdbc(at)postgresql(dot)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(at)dunlops(dot)
> 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/

Browse pgsql-jdbc by date

  From Date Subject
Next Message Eric Jain 2009-09-28 23:51:09 Compression
Previous Message Kris Jurka 2009-09-26 14:46:30 Re: Wrong column default values