The pool (or more accurately, the PooledConnectionFactory used by the pool)
when it's evicting PooledConnections.  The example is incomplete, and as
you've quietly pointed out, not quite right.  It would have to be a
protected method, or be invoked by something else within PooledConnection
(e.g., add "if(null == _sourcePool) { _close(); }" to close()).

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 10:15 AM
To: [EMAIL PROTECTED]
Subject: RE: [Latka] Developer's Guide / Coding Style



> Here's an example of what I'm talking about:
> 
> public class PooledConnection extends Connection {
>     public PooledConnection(Connection delegate) {
>         _delegate = delagate;
>     }
> 
>     public void someMethod() throws SQLException {
>         _delegate.someMethod();
>     }
> 
>     public void close() throws SQLException {
>        _sourcePool.returnObject(this);
>     }
> 
>     private void _close() throws SQLException {
>        _delegate.close();
>     }
> 
>     private Connection _delegate = null;
>     private Pool _sourcePool = null;
> }

Just a question: in this example, who invokes the private version of the
close (_close)?

Ringo

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

Reply via email to