tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hole" <andremailingl...@gmail.com>
Subject Re: Datasource Property Parameters (Oracle) JNDI
Date Fri, 11 Jan 2008 12:32:49 GMT
Hello!

I think that I have the same problem.

<Resource name="ehr" auth="Container" type="oracle.jdbc.pool.OracleDataSource"
	factory="oracle.jdbc.pool.OracleDataSourceFactory"
	driverClassName="oracle.jdbc.OracleDriver"
	url="jdbc:oracle:thin:@192.168.1.244:1521:SID" user="aaaa"
password="aaaat" InitialLimit="5" MinLimit="5" MaxLimit="10" debug="5"
/>

What you are saying is that i can't use pooling on Tomcat/JNDI or only
in case of oracle.jdbc.pool.OracleDataSourceFactory?

Thanks a lot


On Jan 11, 2008 11:29 AM, Rainer Jung <rainer.jung@kippdata.de> wrote:
> Berglas, Anthony wrote:
> > Hello,
> >
> > I am trying to set up 0racle connection pooling.   Some of the
> > parameters are reflected normally, but some are specified via a property
> > lists.  How do I set the property list properties using Tomcat/JNDI?  I
> > can set up the basic DataSource, but I cannot set the maxLimit parameter
> > on the max number of connections because they are in the
> > setConnectionCacheProperties property map, not reflected.
>
> The version of commons-dbcp that gets used with Tomcat knows how to
> handle the property map, but unfortunately the simple factory Tomcat
> uses to configure DBCP (which is part of DBCP) doesn't contain the feature.
>
> On July 23rd the factory has been updated to include the property map
> handling. The feature is waiting for a DBCP release (likely 1.3) since
> then :(
>
> We had a little trouble with updating our commons-pool dependency
> recently, so I'm not sure how fast after a dbcp release tomcat will
> actually adopt it.
>
> If it's really important for you, you could build a dbcp snapshot, check
> the commons pool version dependency and replace the components in Tomcat.
>
> Regards,
>
> Rainer
>
> > More specifically, here is my conf/Catalina/localhost/KMS.conf  (My web
> > app is KMS).
> >
> > # cat /opt/tomcat/conf/Catalina/localhost/KMS.xml
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <Context path="/KMS" docBase="KMS" debug="5" reloadable="true"
> > crossContext="true">
> >
> > <Resource name="jdbc/rkm" auth="Container"
> >     type="oracle.jdbc.pool.OracleDataSource"
> >     driverClassName="oracle.jdbc.OracleDriver"
> >     factory="oracle.jdbc.pool.OracleDataSourceFactory"
> >     connectionCachingEnabled="true"
> >
> >     connectionCacheName="KmsConPool"
> >     abandonedConnectionTimeout="200"
> >     connectionWaitTimeout="200"
> >
> >     maxLimit="20"
> >
> >     url="jdbc:oracle:thin:@localhost:1521:rsakmpri"
> >     user="local"
> >     password="-THIS-SHOULD-BE-IGNORED-"
> > /> <!-- maxLimit ignored -->
> >
> > </Context>
> >
> > The problem is that parameters like connectionCachingEnabled are set
> > reflectively and work but some such as MaxLimit are set in property
> > lists.
> >
> > Specifically doing this in ordinary, easy Java, from the Oracle manual:-
> >
> >     OracleDataSource ods = new OracleDataSource();
> >
> >     // set cache properties in map
> >     java.util.Properties prop = new java.util.Properties();
> >     prop.setProperty("MinLimit", "2");
> >     prop.setProperty("MaxLimit", "10");
> >
> >     // set DataSource properties
> >     String url = "jdbc:oracle:oci8:@";
> >     ods.setURL(url);
> >     ods.setConnectionCacheProperties (prop); //
> > <<<<<<<<<<<<<<<<<<<<<<<<<
> >
> >     ods.setUser("hr");
> >     ods.setPassword("hr");
> >     ods.setConnectionCachingEnabled(true);
> >     ods.setConnectionCacheName("ImplicitCache01");
> >     ...
> >     Connection conn = ods.getConnection(user, pass);
> >
> > But of course this is "Enterprise" software, so it must be done in XML,
> > not Java.  Any ideas as to how to do this most welcome.
> >
> > Anthony
> >
> > PS.  I have never seen any reference to the ability to put a file like
> > KMS.xml in the conf area.  I certainly seems to work, and is very
> > necessary -- obviously one does not want site config in a war -- but
> > just not documented as far as I can tell.
> >
> > --
> > Dr Anthony Berglas
> > Ph. +61 7 3227 4410
> > Mob. +61 44 838 8874
> > ABerglas@RSA.com; Anthony@Berglas.org
> >
> >
> > --
> > Dr Anthony Berglas
> > Ph. +61 7 3227 4410
> > Mob. +61 44 838 8874
> > ABerglas@RSA.com; Anthony@Berglas.org
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message