You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Phil Steitz (JIRA)" <ji...@apache.org> on 2006/12/10 00:36:22 UTC

[jira] Resolved: (DBCP-195) Bad performance in PoolableConnectionFactory

     [ http://issues.apache.org/jira/browse/DBCP-195?page=all ]

Phil Steitz resolved DBCP-195.
------------------------------

    Resolution: Duplicate

This is a duplicate of DBCP-102, which has been fixed.

> Bad performance in PoolableConnectionFactory
> --------------------------------------------
>
>                 Key: DBCP-195
>                 URL: http://issues.apache.org/jira/browse/DBCP-195
>             Project: Commons Dbcp
>          Issue Type: Bug
>         Environment: Windows XP pro, Sun solaris.
> Oracle 10g DB. oracle.jdbc.driver.OracleDriver driver.
>            Reporter: oded peer
>
> the activateObject() method in PoolableConnectionFactory has bad performance using the oracle.jdbc.driver.OracleDriver driver.
> conn.setAutoCommit(_defaultAutoCommit); is always called. This issues a sotred procedure in oracle.jdbc.dbacces.DBAccess.setAutoCommit().
> conn.setReadOnly(_defaultReadOnly.booleanValue()); creates a prepared statement and executes it in oracle.jdbc.driver.OracleConnection.setReadOnly()
> I tried to avoid this behavior by doing conditionally, only if the property changed: 
> Connection conn = (Connection)obj;
> if ( _defaultAutoCommit != conn.getAutoCommit ( ) )
> {
> 	conn.setAutoCommit(_defaultAutoCommit);
> }
> if ( (_defaultTransactionIsolation != -1) && conn.getTransactionIsolation ( ) != _defaultTransactionIsolation )
> {
> 	conn.setTransactionIsolation(_defaultTransactionIsolation);
> }			
> if ( (_defaultReadOnly != null) && ! _defaultReadOnly.equals (  Boolean.valueOf ( conn.isReadOnly ( ) ) ) )
> {
> 	conn.setReadOnly(_defaultReadOnly.booleanValue());
> }
> if ( _defaultCatalog != null && ! conn.getCatalog ( ).equals ( _defaultCatalog ) )
> {
> 	conn.setCatalog(_defaultCatalog);
> }
> When running 30 threads this solution takes 10 millis per getConnection(), while the current version takes 90 millis.
> Do you think this solution can cause any problems?
> Thanks,
> Oded

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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