Re: maxconnection

From: "zhuj" <zhuj(at)dragontec(dot)com(dot)cn>
To: <Dave(at)micro-automation(dot)net>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: maxconnection
Date: 2003-06-20 01:41:03
Message-ID: 002501c336cd$02b110a0$d400a8ca@zhuj2k
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-sql

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(at)micro-automation(dot)net>
To: "zhuj" <zhuj(at)dragontec(dot)com(dot)cn>
Cc: <pgsql-jdbc(at)postgresql(dot)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(at)micro-automation(dot)net>
> > To: "zhuj" <zhuj(at)dragontec(dot)com(dot)cn>
> > Cc: <pgsql-jdbc(at)postgresql(dot)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(at)postgresql(dot)org so that
your
> > > > message can get through to the mailing list cleanly
> > > >
> > > --
> > > Dave Cramer <Dave(at)micro-automation(dot)net>
> > >
> > >
> >
> --
> Dave Cramer <Dave(at)micro-automation(dot)net>
>
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message postgre sql 2003-06-20 06:20:30 OODBMS - PostgreSql
Previous Message zhuj 2003-06-20 01:03:32 Re: maxconnection

Browse pgsql-sql by date

  From Date Subject
Next Message Együd Csaba 2003-06-20 05:12:51 Getting one row for each subquery row...?
Previous Message zhuj 2003-06-20 01:03:32 Re: maxconnection