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] Using tomcat7-maven-plugin- 2.0-beta-1: java.lang.RuntimeException: Name jdbc is not bound in this Context
Date Wed, 07 Mar 2012 15:53:14 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Guofeng,

On 3/7/12 5:32 AM, Guofeng Zhang wrote:
> <Resource auth="Container" maxPoolSize="100" minPoolSize="10" 
> name="jdbc/iviewDS" testQuery="select count(*) from T_ROLE"

You might want to use a simper testQuery (like "SELECT 1 FROM DUAL",
for instance). Some RDBMS engines don't have great performance with
"SELECT COUNT(*)" (for instance, MySQL using the InnoDB engine).

Also, does your factory generate a DataSource for which "testQuery" is
a valid property? If you are using Tomcat's standard connection poll
(DBCP's BasicDataSource) or Tomcat's "other" pool (jdbc-pool), then
the proper configuration attribute is "validationQuery".

See
http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html#JDBC_Data_Sources

Specifically, step #4 under that heading.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9XhGoACgkQ9CaO5/Lv0PB7yACguvu8xlUz6Yf+MJKMqv5NH0V9
Lv0AnA+8Qyo5NUClxyAJHsfMIaaBbXXk
=K1IB
-----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