Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id E433A9FBFB3 for ; Wed, 24 Oct 2007 16:29:24 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 77184-01 for ; Wed, 24 Oct 2007 16:29:08 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by postgresql.org (Postfix) with ESMTP id 4C14F9FB2E5 for ; Wed, 24 Oct 2007 16:29:15 -0300 (ADT) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 3F27A39CFE; Wed, 24 Oct 2007 15:29:14 -0400 (EDT) Received: from web7.messagingengine.com ([10.202.2.216]) by compute1.internal (MEProxy); Wed, 24 Oct 2007 15:29:14 -0400 Received: by web7.messagingengine.com (Postfix, from userid 99) id 18ABEEA17; Wed, 24 Oct 2007 15:29:14 -0400 (EDT) Message-Id: <1193254154.25036.1217646555@webmail.messagingengine.com> X-Sasl-Enc: Cc00lP9pGJO3O0m5w8tMKFCu5yhGBHnyAeCfXgSCA3dK 1193254154 From: "Matthew Storer" To: "Heikki Linnakangas" Cc: "PostgreSQL JDBC List" Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="ISO-8859-1" MIME-Version: 1.0 X-Mailer: MessagingEngine.com Webmail Interface References: <1193159536.9909.1217408695@webmail.messagingengine.com> <471E39E1.7080907@enterprisedb.com> Subject: Re: "Something unusual has occured" error using PostgreSQL 8.2 with Apache Commons DBCP 1.2.2 In-Reply-To: <471E39E1.7080907@enterprisedb.com> Date: Wed, 24 Oct 2007 19:29:14 +0000 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/132 X-Sequence-Number: 17704 Hi Heikki - I think I should be able to put together a simple test class that demonstrates the behavior, that is, assuming the problem is in fact with the code in question. In any case, after I got home yesterday I tried to implement a pool using a BasicDataSource object instead of what I was doing with the PoolingDriver, and I haven't run into any problems at all with that. I'm able to open new connections until all available are full, at which point it blocks until one is freed, just like I'd expect it to do. Still using J2SE 1.6 with Postgre's jdbc4 drivers. go figure. Do you still want me to post an example class that demonstrates the bug? I don't need a solution any more personally, but if you want to find the bug for bug-squashing's sake, I can throw one together and post it in the near-term. take care, and thanks to all for the quick replies - Matt On Tue, 23 Oct 2007 19:13:53 +0100, "Heikki Linnakangas" said: > Matthew Storer wrote: > > To start, I'm putting together a Java client-server app, where the > > server side talks to a PostgreSQL database via an Apache Commons DBCP > > link for connection pooling. Using the code I've included below, I'm > > able to establish a connection, get database metadata, and execute > > stored functions perfectly well PROVIDING I DON'T try to call > > getConnection() again without closing the first connection beforehand. > > (but it seems to me that doing that ought to work alright, because if I > > call getConnection() a second time, shouldn't the DBCP code just pull a > > new connection from the pool, and not, instead, throw this exception?) > > Can you reduce it to a self-contained test case? That way others can > test and help with it as well. > > > EXCEPTION: > > ---------- > > org.postgresql.util.PSQLException: Something unusual has occured to > > cause the driver to fail. Please report this exception. > > at org.postgresql.Driver.connect(Driver.java:276) > > at java.sql.DriverManager.getConnection(Unknown Source) > > at java.sql.DriverManager.getConnection(Unknown Source) > > at > > org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:68) > > at > > org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294) > > at > > org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:840) > > at > > org.apache.commons.dbcp.PoolingDriver.connect(PoolingDriver.java:176) > > > > at java.sql.DriverManager.getConnection(Unknown Source) > > at java.sql.DriverManager.getConnection(Unknown Source) > > at > > myproject.db.ConnectionPool.getConnection(ConnectionPool.java:136) > > Is that the whole stack trace? The stack trace of the underlying > exception should be there as well. > > -- > Heikki Linnakangas > EnterpriseDB http://www.enterprisedb.com