Bad performance in PoolableConnectionFactory
--------------------------------------------

         Key: WSCOMMONS-56
         URL: http://issues.apache.org/jira/browse/WSCOMMONS-56
     Project: WS-Commons
        Type: Bug

  Components: General  
 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]

Reply via email to