pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki@enterprisedb.com>
To: Matthew Storer <matthewstorer@fastmail.us>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: "Something unusual has occured" error using PostgreSQL 8.2 with Apache Commons DBCP 1.2.2
Date: Tue, 23 Oct 2007 19:13:53 +0100
Message-ID: <471E39E1.7080907@enterprisedb.com> (raw)
In-Reply-To: <1193159536.9909.1217408695@webmail.messagingengine.com>
References: <1193159536.9909.1217408695@webmail.messagingengine.com>

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



view thread (6+ messages)  latest in thread

Message-ID: <471E39E1.7080907@enterprisedb.com>
Permalink:  ../471E39E1.7080907@enterprisedb.com/
Also on:    postgresql.org/message-id/471E39E1.7080907@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: heikki@enterprisedb.com, matthewstorer@fastmail.us
  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>
  References: <1193159536.9909.1217408695@webmail.messagingengine.com> <471E39E1.7080907@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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