Re: Connection Pooling with Tomcat 4.1 and SQL Server 2000
Everything you did with the driver,server.xml,web.xml is ok. But it sounds like your driver of sql server 2000 doesnt support connection pooling ... did you tried to connect without the connection pool? i also recommend going to tomcat 5... i had a couple of issues with connection pooling in tomcat 4 with db2 so i went to tomcat 5. now everything is just better. Johnson, Jay escribió: I am trying to establish a connection pool in Tomcat 4.1 to SQL Server 2000. Looking at the SQL Server trace utility, it appears Tomcat connects with the correct username/password and then the following exception is thrown: java.lang.UnsupportedOperationException at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSourc e.java:161). I have taken the following steps: 1)Moved the driver jar files to /common/lib/ 2)Modified the Server.xml file 3)Modified the web.xml file of the application Here is my Server.xml entry: DefaultContext Resource name=jdbc/test auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/test parameter namedriverClassName/name valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/value /parameter parameter nameurl/name valuejdbc:microsoft:sqlserver://localhost:1433/value /parameter parameter nameusername/name valuejay/value /parameter parameter namepassword/name valuejay/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value10/value /parameter parameter namemaxWait/name value100/value /parameter /ResourceParams /DefaultContext Here is my entry in the web.xml file: resource-ref descriptionDB Connection/description res-ref-namejdbc/test/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Are any additional entries needed? Any help would be greatly appreciated! Thanks, Jay Johnson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 4.1 DBCP DB2 Problem (UPDATED)
hi everyone. The problem did show up again in the web application. So the solution of upgrading the dbcp.jar helped performance but did not solve the situation. I found this site: http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/bridge.doc.html/ ... The JDBC-ODBC Bridge driver is recommended only for experimental use or when no other alternative is available. 9.2JDBC-ODBC Bridge If possible, use a Pure Java JDBC driver instead of the Bridge and an ODBC driver. This completely eliminates the client configuration required by ODBC. It also eliminates the potential that the Java VM could be corrupted by an error in the native code brought in by the Bridge (that is, the Bridge native library, the ODBC driver manager library, the ODBC driver library, and the database client library). The JDBC-ODBC Bridge driver is recommended for use in prototyping efforts and for cases where no other JDBC technology-based driver exists. If a commercial, all-Java JDBC driver is available, we recommend that it be used instead of the Bridge. .../ and this site: http://java.sun.com/j2se/1.4.2/docs/guide/jdbc/bridge.html ... /The JDBC-ODBC Bridge should be considered a transitional solution. Sun Microsystems and DataDirect Technologies are working to make the Bridge more reliable and robust, but they do not consider it a supported product. With the development of pure Java JDBC drivers, the JDBC-ODBC Bridge should become unnecessary./ ... That clearly states that the JDBC Driver (sun.jdbc.odbc.JdbcOdbcDriver) should not be used for production sites (ups!). So i test the db2 app driver (db2java.zip) (COM.ibm.db2.jdbc.app.DB2Driver) that comes with db2 connect in development site and everything worked fine. I changed the production site also, we just have to wait and see if the problems shows up again. In mean time, i found out that the site perfoms faster with the new driver (oohlala!). Do any of you think that the problem maybe the java code in the web application more than the application server? or maybe the db2 server? Friedrich Gonzalez
Re: Tomcat 4.1 DBCP DB2 Problem
I think i should add something to my own thread. I check the site of dbcp http://jakarta.apache.org/commons/dbcp/downloads.html and found that i had the old version of commons-dbcp (1.1) and commons-pool (1.2) the release notes say something about Performance optimizations in the PoolableConnectionFactory (sounds like good to me) http://jakarta.apache.org/commons/dbcp/release-notes-1.2.html so i upgrade to dbcp 1.2.1 and upgrade commons-pool to 1.2 (it was required by the other) How did i do it? i remove the old jars from common\lib in CATALINA_HOME and put the new jars downloaded from the site (commons-pool-1.2.jar, commons-dbcp-1.2.1.jar). I just have to wait to see if the problem come backs again. i'll let you know if something happens in the next days. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 4.1 DBCP DB2 Problem
Hi; this is my first post, and i apprecciate a lot your help. We have a Tomcat Application Server 4.1.30, Sun JVM 1.4.2_05 in W2K server (512 ram) connected to a DB2 6.X resident in a IBM/390. The web application performs several access to the DB2 for each user. We have normally 200 connections to the database. The application acesses lots of BLOB registries in those connections. We use a connection pool of 400 connections at maximum. It performs well most of the time. But sometimes when the load is heavy (it is happening more or less each week), like 20 users at a time, Tomcat does not show any error but leaves a lock in the BLOB table without commit for hours, we realize there is a problem when we see time out errors in the logs of tomcat. What happens next is that there is no way to release that lock on the BLOB table, even if we shutdown the w2k server the lock remains in the DB2. The only way is to kill the DB2 thread in the DB2 server in the IBM/390 or bring down DDF. After that, the web application can access the blob registry that was unaccessible without restarting tomcat. We have been unable to repeat the problem in the development site. Even on the same machine. The server is not full in cpu processor, nor the database has any problem (apparently). Some other applications use the database without problem. I would greatly appreciatte somebody here can give me a hint about any of this. This is a critical application for us. My manager is even thinking of replacing Tomcat with WAS 5.0 from IBM. But i dont think that would solve the problem. this is my server.xml: (PSDRS7B is production, DB2TEST is development) thank you for reading, i know is too long. - ?xml version='1.0' encoding='utf-8'? Server className=org.apache.catalina.core.StandardServer debug=0 port=8005 shutdown=SHUTDOWN Listener className=org.apache.catalina.mbeans.ServerLifecycleListener debug=0 jsr77Names=false/ Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener debug=0/ GlobalNamingResources Resource auth=Container description=User database that can be updated and saved name=UserDatabase scope=Shareable type=org.apache.catalina.UserDatabase/ Resource name=PSDRS7B scope=Shareable type=javax.sql.DataSource/ Resource name=DB2TEST scope=Shareable type=javax.sql.DataSource/ ResourceParams name=UserDatabase parameter namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter parameter namepathname/name valueconf/tomcat-users.xml/value /parameter /ResourceParams ResourceParams name=PSDRS7B parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter nameurl/name valuejdbc:odbc:PSDRS7B/value /parameter parameter namevalidationQuery/name valueSELECT CODIGOSOLUCION FROM PSDRS7B.RESPUEST/value /parameter parameter namemaxIdle/name value200/value /parameter parameter namemaxActive/name value500/value /parameter parameter namedriverClassName/name valuesun.jdbc.odbc.JdbcOdbcDriver/value /parameter parameter namemaxWait/name value-1/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameusername/name valueVM6GSR2/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value10/value /parameter parameter namepassword/name valueWEBF1RE/value /parameter /ResourceParams ResourceParams name=DB2TEST parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namevalidationQuery/name valueSELECT CODIGOSOLUCION FROM TSDRS7B.RESPUEST/value /parameter parameter namemaxWait/name value-1/value /parameter parameter namemaxActive/name value500/value /parameter parameter namepassword/name valueESTH3R/value /parameter parameter nameurl/name valuejdbc:odbc:DB2TEST/value /parameter parameter namedriverClassName/name valuesun.jdbc.odbc.JdbcOdbcDriver/value /parameter parameter namemaxIdle/name value200/value /parameter parameter nameusername/name valueVM6GLC1/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name