Date: 2005-03-10T05:15:17 Editor: DavidTonhofer Wiki: Jakarta Commons Wiki Page: DBCP URL: http://wiki.apache.org/jakarta-commons/DBCP
no comment Change Log: ------------------------------------------------------------------------------ @@ -67,10 +67,12 @@ '''1''': Saying what class or interface a JNDI context lookup will return: 'javax.sql.!DataSource'. -'''2''': Saying what class will actually create instances of the above, i.e. give the factory. We use -the 'org.apache.commons.dbcp.!BasicDataSourceFactory'. It creates +'''2''': Saying what class will actually create instances of the above, i.e. give the factory. This is actually +not necessary if you want 'org.apache.commons.dbcp.!BasicDataSourceFactory' as that is the default factory +used by Tomcat whenever 'javax.sql.!DataSource' objects should be created. By setting 'factory', you can +override that default value. 'o.a.c.d.!BasicDataSourceFactory' creates 'org.apache.commons.dbcp.!BasicDataSource' instances. These use a resource pool of type -'org.apache.commons.pool.impl.!GenericObjectPool'. Finally, for this type of pool we can demand that objects +'org.apache.commons.pool.impl.!GenericObjectPool'. And for this type of pool we can demand that objects be verified at borrowing time - which is what we want as it will prevent Tomcat getting its paws on stale database connections. @@ -82,15 +84,14 @@ Additionally (and one level down, if you will) the 'Driver' named in '!driverClassName' is itself configured through the URL used when a new connection is created -Following the [http://issues.apache.org/bugzilla/show_bug.cgi?id=24723 bug 24723] I have put -the 'Resource' definition into the '!GlobalNamingResource' instead of the 'Context' -definition. Where it should be according to the documentation. +I have put the 'Resource' element into the '!GlobalNamingResource' element instead of the 'Context' +element. If you want to put it in the 'Context' element, the 'Realm' must be in the same 'Context' element +and must additionally have the attribute 'localDataSource' set to 'true'. * [http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/server.html Tomcat 5.5 'server' element configuration]. * [http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html Tomcat 5.5 JNDI-DataSource examples] * [http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html#Resource%20Definitions The definition of 'resource'] * [http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-resources-howto.html Tomcat 4.1 JDNI resources howto] - * [http://forums.devshed.com/archive/t-120081 (Outside link) Another trouble report] {{{ <Server ...> @@ -118,9 +119,8 @@ </Server> }}} -Now define the Tomcat Authentication Realm. I have done that inside the Host tag, -because I could not make it work inside the Context tag for some reason. Tomcat gave -an exception in that case. +Now define the Tomcat Authentication Realm. I have put the 'Realm' element inside the 'Host' element, +but as said above you can put it into the 'Context' element, too. The Realm implementation is 'org.apache.catalina.realm.!DataSourceRealm'; it will use a 'javax.sql.!DataSource' interface found in the JNDI initial context. The location of --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
