> Eung-ju Park wrote:
> 
> I does not understand below two things.
> 
> 1. org.apache.avalon.excalibur.datasource.JdbcDataSource class has dispose() method
> but not implements Disposable interface.
> Why?

Good catch.  Will change.  I put the code in so that the system would clean up after
itself, but forgot to put the Disposable interface there.

> 2. JdbcDataSource.run() execute grow() method only one time. Why?

The run() method is an init time asynchronous process.  It initializes the
pool with the minimum number of connections.  After that, the grow and
shrink methods are maintained by the normal HardResourceLimitingPool
semantics.

The JdbcDataSource takes advantage of what is known as a Future.  A Future
is an object that delays processing until a later time.  Usually, the processing
is happening concurrently, and the first access to the object will wait for the
initial processing to finish.

The reasoning for this approach is that many JDBC drivers use wire protocols
to transfer information to and from the DB, and the handshaking can take a
fair amount of time for each connection.  In most applications, by the time the
first need for a DB connection arrises, the pool is already initialized.
The benefit is that the rest of the system's initialization can continue while
the pool is being populated.

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

Reply via email to