commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Waldhoff, Rodney" <rwald...@us.britannica.com>
Subject RE: [Latka] Developer's Guide / Coding Style
Date Fri, 22 Mar 2002 16:18:35 GMT
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: ringo.desmet@mediagenix.com [mailto:ringo.desmet@mediagenix.com]
Sent: Friday, March 22, 2002 10:15 AM
To: commons-dev@jakarta.apache.org
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:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:commons-dev-help@jakarta.apache.org>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message