commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Verbeeck <dirk.verbe...@pandora.be>
Subject Re: [dbcp] meanings of active, idle
Date Mon, 27 Jun 2005 06:11:20 GMT
Strange, there is a junit test doing the test you describe:
http://jakarta.apache.org/commons/dbcp/xref-test/org/apache/commons/dbcp/TestBasicDataSource.html#218
and it works for me.

Can you post your test?

Tnx
Dirk

mark archur wrote:
> Dirk/All,
> 
> Thanks for the reply.
> 
> Your definition of "Active" (and also "Idle") looks convincing to me, but my tests do
not prove the same. We know that there is a parameter called “initialSize” introduced
in version 1.2. I set initialSize to 12. In my program, when I print getNumActive(), it gives
me a value 12. 
> 
> If I understand the meaning of initialSize, it should JUST create connections in the
pool and the connection should not yet be open (active) right?? The fact that it getNumActive()
gave me value 12, does it mean it has 12 active connections(connections which are open by
the program)?
> 
> AND, when I call basicDataSource.getConnection(), it returns me a connection right. Now,
before closing this connection, I called getNumActive(), it prints 13. Does this prove that
having initialSize in the settings really creates 12 ACTIVE (open-but-not-yet-closed) connections?
> 
>  
> 
> FYI: I am creating the basicDataSource by invoking BasicDataSourceFactory.createDataSource(Properties)
method. And I cache basicDataSource so I can reuse it.
> 
>  
> 
> Am I missing anything basic here.
> 
>  
> 
> Thanks,
> 
>  
> 
> Pramodh.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message