Re: PooledConnectionImpl problem

From: Aaron Mulder <ammulder(at)alumni(dot)princeton(dot)edu>
To: PostgreSQL JDBC <pgsql-jdbc(at)postgresql(dot)org>
Cc: Dave Cramer <Dave(at)micro-automation(dot)net>
Subject: Re: PooledConnectionImpl problem
Date: 2002-12-11 02:13:33
Message-ID: Pine.LNX.4.44.0212102106310.6921-300000@www.princetongames.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tue, 10 Dec 2002, Mike Beachy wrote:
> p.s. I think I see what you mean now - createStatement() gets added to
> ConnectionHandler as one of the intercepted methods; it calls
> createStatement() on the real Connection, but wraps the result in a
> Statement proxy that intercepts calls to getConnection and returns the
> Connection proxy instead of the actual Connection?

Exactly so.

I've attached context diffs for
org.postgresql.test.jdbc2.optional.ConnectionPoolTest and
org.postgresql.jdbc2.optional.PooledConnectionImpl.
The updated test does what Mike suggested, for Statements,
PreparedStatements, and CallableStatements. The updated PooledConnection
adds a statement proxy as described above.

Aaron

P.S. When I run the test suite against my 7.2.2 server with the JDBC3
driver, I get a failure in DatabaseMetaData.testTables. It is returning
the name of the first table in the database, so the table name criterion
doesn't seem to be working:

testTables(org.postgresql.test.jdbc2.DatabaseMetaDataTest)
junit.framework.AssertionFailedError at
org.postgresql.test.jdbc2.DatabaseMetaDataTest.testTables(DatabaseMetaDataTest.java:56)

Attachment Content-Type Size
ConnectionPoolTest.diff text/plain 2.9 KB
PooledConnectionImpl.diff text/plain 6.5 KB

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2002-12-11 11:29:42 Re: PooledConnectionImpl problem
Previous Message Mike Beachy 2002-12-10 23:40:37 Re: PooledConnectionImpl problem