tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: [OT] Context Chicken & Egg Problem
Date Tue, 15 Dec 2009 19:49:09 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David,

I'm bringing this back onto the list in case it helps anyone. Also
marking OT.

On 12/15/2009 1:42 PM, David Fisher wrote:
> We designed things during the Tomcat 3 timeframe. I will need to push my
> developer to do it the JNDI way, I'll likely have to do it myself.
> 
> I've found these resources:
> 
> http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html
> http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
> 
> Are there other resources that you would recommend for configuring JDBC
> through JNDI?

Those are pretty comprehensive. Configuring JNDI DataSources isn't all
that hard: just put a <Resource> element into your <Context> and make
sure your driver's JAR file is available to the common ClassLoader (so
Tomcat can create the objects, and your code can use them).

> Any technotes about db failover, etc. Should we consider
> DBCP?

All db failover should be done through your driver. Tomcat uses
commons-dbcp under the hood, so you're already using connection pooling.
There's a newer pool available if you want to try it out (higher
performance, more features), but it appears to have a few bugs in it,
and it's not really ready for prime-time.

> How well does this technique work in an Eclipse environment?

Eclipse should be able to run Tomcat normally and the use of JNDI
shouldn't be a problem. I don't use Eclipse, though, so I don't know for
sure. I haven't read too many complaints on the list about JNDI not
working via Eclipse.

>> I'm pretty sure that the Oracle JDBC drivers are compatible with all
>> versions of the server. You should use the most up-to-date version of
>> the Oracle JDBC driver that you can find, regardless of the server
>> version.
> 
> I know it, but then I have a conservative developer who is afraid of
> taking the risk, even though Oracle says the 10g JDBC is ok with Oracle 8.

I didn't think Oracle even had server-version-specific JDBC drivers.
Anyhow, go ahead and use the version-matched JDBC driver if it makes
your developers happy. No matter what you do, make sure to test the hell
out of it before it goes into production :)

> We have a JIRA instance that requires the Oracle 9 drivers and my oracle
> session view is missing the os_user and program from that system's
> connections. So, I can't argue too strongly to update our jdbc jar.

Hmm... that's definitely a problem when it comes to Tomcat-managed
DataSources: all webapps must use the same driver version.

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksn6DUACgkQ9CaO5/Lv0PCTFgCeMMdLX3kKtgnTs3ud6LhHjaSD
QfIAn08yBCQINkPMSvDIcIi3TfC5lvas
=sR9Z
-----END PGP SIGNATURE-----

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


Mime
View raw message