commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Bray (CAPE)" <daniel.b...@capetechnologies.com>
Subject RE: turning off connection pooling in tomcat 4.1.24
Date Thu, 16 Oct 2003 08:15:40 GMT

>> 1. To instantiate an oracle Array object

This looks like my problem; thanks I'll give this a look-see.



-----Original Message-----
From: Phillip Qin [mailto:Phillip.Qin@shareowner.com]
Sent: 14 October 2003 20:30
To: 'Jakarta Commons Users List'
Subject: RE: turning off connection pooling in tomcat 4.1.24


Dan,

Can you be more specific? Which "oracle-specific" stuff you cannot overcome?
There are only 2 places that I have to use Oracle classes.

1. To instantiate an oracle Array object

ArrayDescriptor desc =
ArrayDescriptor.createDescriptor(sqlArrayType, conn);
Array array = new ARRAY(desc, conn, ids);

ArrayDescriptor is an Oracle class, Array is Oracle's implementation of
standard ARRAY classes. Connection is dbcp DelegatingConnection (hence
instance of standard Connection).

Since Oracle requires OrcleConnection to be passed to constructor, I had to
use ((DelegatingConnection) conn).getInnermostDelegate()

2. BFILE.

For the rest of the sql classes, I always use standard ones, e.g. ResultSet,
CallableStatement, etc. They will be parsed to oracle-specific classes/data
types by oracle JDBC driver.

-----Original Message-----
From: Dirk Verbeeck [mailto:dirk.verbeeck@pandora.be]
Sent: October 13, 2003 3:15 PM
To: Jakarta Commons Users List
Subject: Re: turning off connection pooling in tomcat 4.1.24

Access to the underlying connection is supported is you set
(accessToUnderlyingConnectionAllowed=true)
see http://jakarta.apache.org/commons/dbcp/configuration.html

But if you want "a simple connection to the database" then you can use
this factory:
oracle.jdbc.pool.OracleDataSourceFactory

Dirk


Daniel Bray (CAPE) wrote:

>Howdy; I have a strange set up problem here that I can't quite figure out:
>it should be trivial, but I can't get it to work.
>
>
>We've got some code that's oracle-specific (it needs to get to the
>OracleCallableStatement) and I can't get this changed; so rather than
>attempt to side-step the PoolableConnection or whatever
>org.apache.commons.dbcp.BasicDataSourceFactory is doing, I'd like to define
>a resource in my server.xml file that doesn't implement connection pooling:
>i.e. just returns me a connection of the flavour of whatever database I'm
>using at the time.
>
>Like I said: I don't want to just get the dbcp.PoolableConnection's
delegate
>connection and fool with it 'cause I don't know how that'll affect the
>pooling: I don't want something outside this connection affecting it, or
>vice-versa.
>
>
>My problem is that when I remove the following "factory" parameter from my
>resource; tomcat *still* uses the dbcp factory.
>
><parameter>
>  <name>factory</name>
>  <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
></parameter>
>
>
>Now, I took a look inside this guy:
>org.apache.naming.factory.ResourceFactory
>
>and found this:
>String javaxSqlDataSourceFactoryClassName =
>  System.getProperty("javax.sql.DataSource.Factory",
>"org.apache.commons.dbcp.BasicDataSourceFactory");
>
>which would suggest that the default data source factory is the DBCP one.
>
><deep breath>
>
>So here's my question: is there a factory I can use that'll just return a
>simple connection to the database? Basically I'm after the one I'd get by
>calling PoolableConnection.getDelegate().
>I've looked for one but I can't find anything anywhere.
>
>
>Thanks.
>
>
>from me, daniel.
>
>






---------------------------------------------------------------------
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