[ http://issues.apache.org/jira/browse/DBCP-195?page=comments#action_12424297 ] David Illsley commented on DBCP-195: ------------------------------------
Moved from WS-Commons 'cos it looked out of place. Apologies if this is not the correct destination. > 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]