pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
DataSource.setMaxConnections() - Does not work
4+ messages / 3 participants
[nested] [flat]

* DataSource.setMaxConnections() - Does not work
@ 2009-09-26 13:25 Michael Andreasen <michael@dunlops.com>
  2009-09-26 13:27 ` Re: DataSource.setMaxConnections() - Does not work Michael Andreasen <michael@dunlops.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Michael Andreasen @ 2009-09-26 13:25 UTC (permalink / raw)
  To: pgsql-jdbc

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

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: DataSource.setMaxConnections() - Does not work
  2009-09-26 13:25 DataSource.setMaxConnections() - Does not work Michael Andreasen <michael@dunlops.com>
@ 2009-09-26 13:27 ` Michael Andreasen <michael@dunlops.com>
  2009-09-26 13:51   ` Re: DataSource.setMaxConnections() - Does not work Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Michael Andreasen @ 2009-09-26 13:27 UTC (permalink / raw)
  To: pgsql-jdbc

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

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: DataSource.setMaxConnections() - Does not work
  2009-09-26 13:25 DataSource.setMaxConnections() - Does not work Michael Andreasen <michael@dunlops.com>
  2009-09-26 13:27 ` Re: DataSource.setMaxConnections() - Does not work Michael Andreasen <michael@dunlops.com>
@ 2009-09-26 13:51   ` Kris Jurka <books@ejurka.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Kris Jurka @ 2009-09-26 13:51 UTC (permalink / raw)
  To: Michael Andreasen <michael@dunlops.com>; +Cc: pgsql-jdbc



On Sat, 26 Sep 2009, Michael Andreasen wrote:

> Even though I set it at 3, if I look on the server I can see many more
> connections have been made?

The three connection limit is the most the datasource will open for you, 
but it cannot prevent other people/processes from opening other 
connections to the server.  If you really believe all of these are being 
opened by the datasource, perhaps you really have many instances of the 
datasource, each of which will open up to three connections.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: DataSource.setMaxConnections() - Does not work
@ 2009-09-27 10:39 J. W. Ulbts <magog001@web.de>
  0 siblings, 0 replies; 4+ messages in thread

From: J. W. Ulbts @ 2009-09-27 10:39 UTC (permalink / raw)
  To: 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@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/




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2009-09-27 10:39 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-09-26 13:25 DataSource.setMaxConnections() - Does not work Michael Andreasen <michael@dunlops.com>
2009-09-26 13:27 ` Michael Andreasen <michael@dunlops.com>
2009-09-26 13:51   ` Kris Jurka <books@ejurka.com>
2009-09-27 10:39 Re: DataSource.setMaxConnections() - Does not work J. W. Ulbts <magog001@web.de>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox