pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
maxconnection
7+ messages / 4 participants
[nested] [flat]

* maxconnection
@ 2003-06-17 09:22 zhuj <zhuj@dragontec.com.cn>
  2003-06-19 18:38 ` Re: [JDBC] maxconnection Paul Thomas <paul@tmsl.demon.co.uk>
  2003-06-19 20:23 ` Re: maxconnection Dave Cramer <Dave@micro-automation.net>
  0 siblings, 2 replies; 7+ messages in thread

From: zhuj @ 2003-06-17 09:22 UTC (permalink / raw)
  To: pgsql-jdbc@postgresql.org

hi,all:
    I want to constraint the maximum number of concurrent connections to 25
in postgres
jdbc driver. There are no methods for this
change. How would i do?

TIA
                                 zhuj





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

* Re: [JDBC] maxconnection
  2003-06-17 09:22 maxconnection zhuj <zhuj@dragontec.com.cn>
@ 2003-06-19 18:38 ` Paul Thomas <paul@tmsl.demon.co.uk>
  1 sibling, 0 replies; 7+ messages in thread

From: Paul Thomas @ 2003-06-19 18:38 UTC (permalink / raw)
  To: pgsql-sql


On 17/06/2003 10:22 zhuj wrote:
> hi,all:
>     I want to constraint the maximum number of concurrent connections to
> 25
> in postgres
> jdbc driver. There are no methods for this
> change. How would i do?

The simplest way is to use a connection pool.

HTH

-- 
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller 
Business |
| Computer Consultants         | 
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+---------------------------------------------+



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

* Re: maxconnection
  2003-06-17 09:22 maxconnection zhuj <zhuj@dragontec.com.cn>
@ 2003-06-19 20:23 ` Dave Cramer <Dave@micro-automation.net>
  2003-06-20 01:03   ` Re: maxconnection zhuj <zhuj@dragontec.com.cn>
  1 sibling, 1 reply; 7+ messages in thread

From: Dave Cramer @ 2003-06-19 20:23 UTC (permalink / raw)
  To: zhuj <zhuj@dragontec.com.cn>; +Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>

You have to limit the connections on the backend, in postgresql.conf.

Dave
On Tue, 2003-06-17 at 05:22, zhuj wrote:
> hi,all:
>     I want to constraint the maximum number of concurrent connections to 25
> in postgres
> jdbc driver. There are no methods for this
> change. How would i do?
> 
> TIA
>                                  zhuj
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly
> 
-- 
Dave Cramer <Dave@micro-automation.net>




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

* Re: maxconnection
  2003-06-17 09:22 maxconnection zhuj <zhuj@dragontec.com.cn>
  2003-06-19 20:23 ` Re: maxconnection Dave Cramer <Dave@micro-automation.net>
@ 2003-06-20 01:03   ` zhuj <zhuj@dragontec.com.cn>
  2003-06-20 00:58     ` Re: maxconnection Dave Cramer <Dave@micro-automation.net>
  2003-06-23 14:07     ` Re: maxconnection scott.marlowe <scott.marlowe@ihs.com>
  0 siblings, 2 replies; 7+ messages in thread

From: zhuj @ 2003-06-20 01:03 UTC (permalink / raw)
  To: Dave@micro-automation.net; +Cc: pgsql-jdbc@postgresql.org

I try to edit the postgresql.conf, set
"max_connections " to 25 then restart
postgres, but it seems not work.

----- Original Message -----
From: "Dave Cramer" <Dave@micro-automation.net>
To: "zhuj" <zhuj@dragontec.com.cn>
Cc: <pgsql-jdbc@postgresql.org>
Sent: Friday, June 20, 2003 4:23 AM
Subject: Re: [JDBC] maxconnection


> You have to limit the connections on the backend, in postgresql.conf.
>
> Dave
> On Tue, 2003-06-17 at 05:22, zhuj wrote:
> > hi,all:
> >     I want to constraint the maximum number of concurrent connections to
25
> > in postgres
> > jdbc driver. There are no methods for this
> > change. How would i do?
> >
> > TIA
> >                                  zhuj
> >
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 3: if posting/reading through Usenet, please send an appropriate
> >       subscribe-nomail command to majordomo@postgresql.org so that your
> >       message can get through to the mailing list cleanly
> >
> --
> Dave Cramer <Dave@micro-automation.net>
>
>




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

* Re: maxconnection
  2003-06-17 09:22 maxconnection zhuj <zhuj@dragontec.com.cn>
  2003-06-19 20:23 ` Re: maxconnection Dave Cramer <Dave@micro-automation.net>
  2003-06-20 01:03   ` Re: maxconnection zhuj <zhuj@dragontec.com.cn>
@ 2003-06-20 00:58     ` Dave Cramer <Dave@micro-automation.net>
  2003-06-20 01:41       ` Re: maxconnection zhuj <zhuj@dragontec.com.cn>
  1 sibling, 1 reply; 7+ messages in thread

From: Dave Cramer @ 2003-06-20 00:58 UTC (permalink / raw)
  To: zhuj <zhuj@dragontec.com.cn>; +Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>

Really, what happens? I am pretty sure you won't get more than 25
connections.

Dave
On Thu, 2003-06-19 at 21:03, zhuj wrote:
> I try to edit the postgresql.conf, set
> "max_connections " to 25 then restart
> postgres, but it seems not work.
> 
> ----- Original Message -----
> From: "Dave Cramer" <Dave@micro-automation.net>
> To: "zhuj" <zhuj@dragontec.com.cn>
> Cc: <pgsql-jdbc@postgresql.org>
> Sent: Friday, June 20, 2003 4:23 AM
> Subject: Re: [JDBC] maxconnection
> 
> 
> > You have to limit the connections on the backend, in postgresql.conf.
> >
> > Dave
> > On Tue, 2003-06-17 at 05:22, zhuj wrote:
> > > hi,all:
> > >     I want to constraint the maximum number of concurrent connections to
> 25
> > > in postgres
> > > jdbc driver. There are no methods for this
> > > change. How would i do?
> > >
> > > TIA
> > >                                  zhuj
> > >
> > >
> > >
> > > ---------------------------(end of broadcast)---------------------------
> > > TIP 3: if posting/reading through Usenet, please send an appropriate
> > >       subscribe-nomail command to majordomo@postgresql.org so that your
> > >       message can get through to the mailing list cleanly
> > >
> > --
> > Dave Cramer <Dave@micro-automation.net>
> >
> >
> 
-- 
Dave Cramer <Dave@micro-automation.net>




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

* Re: maxconnection
  2003-06-17 09:22 maxconnection zhuj <zhuj@dragontec.com.cn>
  2003-06-19 20:23 ` Re: maxconnection Dave Cramer <Dave@micro-automation.net>
  2003-06-20 01:03   ` Re: maxconnection zhuj <zhuj@dragontec.com.cn>
  2003-06-20 00:58     ` Re: maxconnection Dave Cramer <Dave@micro-automation.net>
@ 2003-06-20 01:41       ` zhuj <zhuj@dragontec.com.cn>
  0 siblings, 0 replies; 7+ messages in thread

From: zhuj @ 2003-06-20 01:41 UTC (permalink / raw)
  To: Dave@micro-automation.net; +Cc: pgsql-jdbc@postgresql.org

I am testing our connection pool program.
The constructor of connection pool class
shows below:
public ConnectionPool(int size, int maxSize) throws  SQLException {
    try {
        this.size = size;
        this.maxSize = maxSize;
        for (int i = 0; i < this.size; i++) {
            PooledConnection pooledConnection = (PooledConnection)
                   DataSource.this.getPooledConnection();// get connection
from postgres
            if (this.connectionMemento == null)
                  this.connectionMemento =
pooledConnection.createConnectionMemento();
            pooledConnection.addConnectionEventListener(this);
            this.pool.add(pooledConnection);
        }
    } catch (SQLException e) {
        closeAll(this.pool);
        throw e;
    }
}

the details of getPooledConnection() method:
public javax.sql.PooledConnection getPooledConnection() throws SQLException
{
        return new PooledConnection(DriverManager.getConnection(this.url,
this.user,
               this.password));
}

The test program create the ConnectionPool object:
    new ConnectionPool(30, 50);

if max connection is set to 25, "new ConnectionPool(30, 50)"
should throw SQLException. But it did not. It runs normally.


----- Original Message -----
From: "Dave Cramer" <Dave@micro-automation.net>
To: "zhuj" <zhuj@dragontec.com.cn>
Cc: <pgsql-jdbc@postgresql.org>
Sent: Friday, June 20, 2003 8:58 AM
Subject: Re: [JDBC] maxconnection


> Really, what happens? I am pretty sure you won't get more than 25
> connections.
>
> Dave
> On Thu, 2003-06-19 at 21:03, zhuj wrote:
> > I try to edit the postgresql.conf, set
> > "max_connections " to 25 then restart
> > postgres, but it seems not work.
> >
> > ----- Original Message -----
> > From: "Dave Cramer" <Dave@micro-automation.net>
> > To: "zhuj" <zhuj@dragontec.com.cn>
> > Cc: <pgsql-jdbc@postgresql.org>
> > Sent: Friday, June 20, 2003 4:23 AM
> > Subject: Re: [JDBC] maxconnection
> >
> >
> > > You have to limit the connections on the backend, in postgresql.conf.
> > >
> > > Dave
> > > On Tue, 2003-06-17 at 05:22, zhuj wrote:
> > > > hi,all:
> > > >     I want to constraint the maximum number of concurrent
connections to
> > 25
> > > > in postgres
> > > > jdbc driver. There are no methods for this
> > > > change. How would i do?
> > > >
> > > > TIA
> > > >                                  zhuj
> > > >
> > > >
> > > >
> > > > ---------------------------(end of
broadcast)---------------------------
> > > > TIP 3: if posting/reading through Usenet, please send an appropriate
> > > >       subscribe-nomail command to majordomo@postgresql.org so that
your
> > > >       message can get through to the mailing list cleanly
> > > >
> > > --
> > > Dave Cramer <Dave@micro-automation.net>
> > >
> > >
> >
> --
> Dave Cramer <Dave@micro-automation.net>
>
>




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

* Re: maxconnection
  2003-06-17 09:22 maxconnection zhuj <zhuj@dragontec.com.cn>
  2003-06-19 20:23 ` Re: maxconnection Dave Cramer <Dave@micro-automation.net>
  2003-06-20 01:03   ` Re: maxconnection zhuj <zhuj@dragontec.com.cn>
@ 2003-06-23 14:07     ` scott.marlowe <scott.marlowe@ihs.com>
  1 sibling, 0 replies; 7+ messages in thread

From: scott.marlowe @ 2003-06-23 14:07 UTC (permalink / raw)
  To: zhuj <zhuj@dragontec.com.cn>; +Cc: Dave@micro-automation.net; pgsql-jdbc@postgresql.org

You likely need to increase the shared_buffers to at least 2* max 
connections.  Do you have logging of any kind turned on?  If you have 
silent_mode set to true, set it to false and try starting the database 
again and look for error messages.  If you've got it set to log somewhere, 
read the logs after trying to restart.  Or by "not work" do you mean it 
doesn't limit the max connections properly?

On Fri, 20 Jun 2003, zhuj wrote:

> I try to edit the postgresql.conf, set
> "max_connections " to 25 then restart
> postgres, but it seems not work.
> 
> ----- Original Message -----
> From: "Dave Cramer" <Dave@micro-automation.net>
> To: "zhuj" <zhuj@dragontec.com.cn>
> Cc: <pgsql-jdbc@postgresql.org>
> Sent: Friday, June 20, 2003 4:23 AM
> Subject: Re: [JDBC] maxconnection
> 
> 
> > You have to limit the connections on the backend, in postgresql.conf.
> >
> > Dave
> > On Tue, 2003-06-17 at 05:22, zhuj wrote:
> > > hi,all:
> > >     I want to constraint the maximum number of concurrent connections to
> 25
> > > in postgres
> > > jdbc driver. There are no methods for this
> > > change. How would i do?
> > >
> > > TIA
> > >                                  zhuj
> > >
> > >
> > >
> > > ---------------------------(end of broadcast)---------------------------
> > > TIP 3: if posting/reading through Usenet, please send an appropriate
> > >       subscribe-nomail command to majordomo@postgresql.org so that your
> > >       message can get through to the mailing list cleanly
> > >
> > --
> > Dave Cramer <Dave@micro-automation.net>
> >
> >
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faqs/FAQ.html
> 




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


end of thread, other threads:[~2003-06-23 14:07 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-06-17 09:22 maxconnection zhuj <zhuj@dragontec.com.cn>
2003-06-19 18:38 ` Paul Thomas <paul@tmsl.demon.co.uk>
2003-06-19 20:23 ` Dave Cramer <Dave@micro-automation.net>
2003-06-20 01:03   ` zhuj <zhuj@dragontec.com.cn>
2003-06-20 00:58     ` Dave Cramer <Dave@micro-automation.net>
2003-06-20 01:41       ` zhuj <zhuj@dragontec.com.cn>
2003-06-23 14:07     ` scott.marlowe <scott.marlowe@ihs.com>

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