You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Chris Nappin <C....@abm-uk.com> on 2004/10/21 18:27:55 UTC

[DBCP] per-user connection pooling

Hi,

 

  I've been trying to get per-user connection pooling working with
Oracle 9i, Tomcat and DBCP: i.e. NOT putting any username or password in
the JNDI settings, then calling "getConnection(username, password)"
instead of "getConnection()".

 

As far as I can see there are two approaches with DBCP:

 

1.	use the driver "directly" via
org.apache.commons.dbcp.BasicDataSourceFactory;
2.	use the driver "indirectly" via the DriverAdapterCPDS wrapper
functionality and
org.apache.commons.dbcp.datasources.PerUserPoolDataSourceFactory.

 

The second method may be fixed in the next nightly build (thanks Dirk
Verbeeck) but so far seems to be quite slow (only 10% quicker than
direct connections). Has anyone ever got the first method working? I get
an exception thrown from the Oracle Driver itself:

 

java.sql.SQLException: invalid arguments in call
        at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
        at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
        at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1160)
        at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:183)
        at
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:346)
        at
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:
468)
        at
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
        at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverC
onnectionFactory.java:37)

 

I've raised an iTAR (bug report) with Oracle but the comments so far
from Oracle support have been to put the blame on the JNDI/DBCP code...

 

Regards
 
Chris Nappin

Senior Analyst Programmer
 
ABM United Kingdom Limited
Telephone: +44 (0) 115 977 6999
Facsimile: +44 (0) 115 977 6850
Web: http://www.abm-uk.com
 
ABM for Intelligent Solutions
 
The information contained in this email is intended only for the named
recipient(s) and may be confidential and/or privileged. Unauthorised use
or reproduction (including storage or re-distribution in any media) is
prohibited.
 
ABM-United Kingdom Limited may monitor the content of e-mails and files
sent and received via its network for the purposes of ensuring
compliance with its legal obligations and its policies and procedures. 

 


Re: [DBCP] per-user connection pooling

Posted by Dirk Verbeeck <di...@pandora.be>.
The default BasicDataSource doesn't support the 
getConnection(username, password) method.

Username and password are properties given to the driver and have to 
be configured on a DataSource level. The oracle error is a strange one 
but is probably correct (no username/password given)

Using the second method is your best bet on the short term.
I can't really say anything about the speed of the 
PerUserPoolDataSource. I did write some performance tests on 
BasicDataSource but not on PerUserPoolDataSource.

If you wtrite some performance tests then I will take a look at them.

Regards
Dirk


Chris Nappin wrote:

> Hi,
> 
>  
> 
>   I've been trying to get per-user connection pooling working with
> Oracle 9i, Tomcat and DBCP: i.e. NOT putting any username or password in
> the JNDI settings, then calling "getConnection(username, password)"
> instead of "getConnection()".
> 
>  
> 
> As far as I can see there are two approaches with DBCP:
> 
>  
> 
> 1.	use the driver "directly" via
> org.apache.commons.dbcp.BasicDataSourceFactory;
> 2.	use the driver "indirectly" via the DriverAdapterCPDS wrapper
> functionality and
> org.apache.commons.dbcp.datasources.PerUserPoolDataSourceFactory.
> 
>  
> 
> The second method may be fixed in the next nightly build (thanks Dirk
> Verbeeck) but so far seems to be quite slow (only 10% quicker than
> direct connections). Has anyone ever got the first method working? I get
> an exception thrown from the Oracle Driver itself:
> 
>  
> 
> java.sql.SQLException: invalid arguments in call
>         at
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
>         at
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
>         at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1160)
>         at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:183)
>         at
> oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:346)
>         at
> oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:
> 468)
>         at
> oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
>         at
> org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverC
> onnectionFactory.java:37)
> 
>  
> 
> I've raised an iTAR (bug report) with Oracle but the comments so far
> from Oracle support have been to put the blame on the JNDI/DBCP code...
> 
>  
> 
> Regards
>  
> Chris Nappin
> 
> Senior Analyst Programmer
>  
> ABM United Kingdom Limited
> Telephone: +44 (0) 115 977 6999
> Facsimile: +44 (0) 115 977 6850
> Web: http://www.abm-uk.com
>  
> ABM for Intelligent Solutions
>  
> The information contained in this email is intended only for the named
> recipient(s) and may be confidential and/or privileged. Unauthorised use
> or reproduction (including storage or re-distribution in any media) is
> prohibited.
>  
> ABM-United Kingdom Limited may monitor the content of e-mails and files
> sent and received via its network for the purposes of ensuring
> compliance with its legal obligations and its policies and procedures. 
> 
>  
> 
> 



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