X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 0C08230EAD7 for ; Fri, 20 Jun 2003 01:31:40 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 56085-07 for ; Thu, 19 Jun 2003 22:31:29 -0300 (ADT) Received: from mail.dragontec.com.cn (unknown [210.22.126.10]) by svr1.postgresql.org (Postfix) with ESMTP id 8F9D230DE10 for ; Thu, 19 Jun 2003 22:31:28 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mail.dragontec.com.cn (Postfix) with ESMTP id 624A11AF3B9; Fri, 20 Jun 2003 09:31:27 +0800 (CST) Received: from mail.dragontec.com.cn (localhost [127.0.0.1]) by localhost (AvMailGate-2.0.1.10) id 19482-507E6B11; Fri, 20 Jun 2003 09:31:27 +0800 Received: from zhuj2k (user212.dragontec.com.cn [202.168.0.212]) by mail.dragontec.com.cn (Postfix) with ESMTP id 4528B1AF3B9; Fri, 20 Jun 2003 09:31:26 +0800 (CST) Message-ID: <002501c336cd$02b110a0$d400a8ca@zhuj2k> From: "zhuj" To: Cc: References: <00dc01c334b2$04876130$d400a8ca@zhuj2k> <1056054233.1307.37.camel@localhost.localdomain> <001701c336c7$c5013b90$d400a8ca@zhuj2k> <1056070724.1307.47.camel@localhost.localdomain> Subject: Re: maxconnection Date: Fri, 20 Jun 2003 09:41:03 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-AntiVirus: checked by AntiVir MailGate (version: 2.0.1.10; AVE: 6.19.0.3; VDF: 6.19.0.26; host: mail) X-Archive-Number: 200306/94 X-Sequence-Number: 7316 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" To: "zhuj" Cc: 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" > > To: "zhuj" > > Cc: > > 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 Cramer > >