https://issues.apache.org/bugzilla/show_bug.cgi?id=51756
Bug #: 51756 Summary: Tomcat JDBC Pool does not work with Sybase Product: Tomcat Modules Version: unspecified Platform: Sun OS/Version: Solaris Status: NEW Severity: normal Priority: P2 Component: jdbc-pool AssignedTo: dev@tomcat.apache.org ReportedBy: windson.rangavajh...@gmail.com Classification: Unclassified hi We wanted to try out the new Tomcat JDBC Pool as our connection pooling software. We followed the bare minimum steps given in the "Plain Ol' Java" section at http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html. We managed to get this connect to SQL Server db properly. But, we are getting the below exception when we try connecting to Sybase db. With JTDS driver **************** java.sql.SQLException: I/O Error: Stream 0 attempting to read when no request has been sent at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1052) at net.sourceforge.jtds.jdbc.TdsCore.submitSQL(TdsCore.java:898) at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:409) at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50) at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:182) at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:267) at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:176) at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:653) at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:595) at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:458) at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:130) at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:99) at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:110) at DBPoolManager.getConnection(DBPoolManager.java:359) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at java.lang.Class.newInstance0(Class.java:372) at java.lang.Class.newInstance(Class.java:325) With JConnect driver ******************** java.sql.SQLException: JZ006: Caught IOException: com.sybase.jdbc3.jdbc.SybConnectionDeadException: JZ0C0: Connection is already closed. at com.sybase.jdbc3.jdbc.ErrorMessage.createIOEKilledConnEx(Unknown Source) at com.sybase.jdbc3.jdbc.ErrorMessage.raiseErrorCheckDead(Unknown Source) at com.sybase.jdbc3.tds.Tds.a(Unknown Source) at com.sybase.jdbc3.tds.Tds.a(Unknown Source) at com.sybase.jdbc3.tds.Tds.language(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.sendQuery(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.execute(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.execute(Unknown Source) at DBPoolManager.getConnection(DBPoolManager.java:372) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at java.lang.Class.newInstance0(Class.java:372) at java.lang.Class.newInstance(Class.java:325) It will be great if you can look into this. FYI: we tried with tomcat 6.0, jtds 1.2.2, 1.2.5 and jConnect 6.05. Below is the code used by us with some of the properties masked. Please note that there is no error in our driver URL which has been working fine with connection pool s/w like snaq. import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; PooplProperties pp = PoolProperties(); pp.setUrl(driverURL); pp.setDriverClassName("net.sourceforge.jtds.jdbc.Driver"); pp.setUsername(login); pp.setPassword(password); pp.setJmxEnabled(true); pp.setTestWhileIdle(false); pp.setTestOnBorrow(true); pp.setValidationQuery("SELECT 1"); pp.setTestOnReturn(false); pp.setValidationInterval(30000); pp.setTimeBetweenEvictionRunsMillis(30000); pp.setMaxActive(maxPoolConn); pp.setInitialSize(initialConn); pp.setMaxAge(expiryTime); pp.setRemoveAbandonedTimeout(60); pp.setMinEvictableIdleTimeMillis(30000); pp.setMinIdle(10); pp.setLogAbandoned(true); pp.setRemoveAbandoned(true); DataSource ds = new DataSource(); ds.setPoolProperties(pp); ds.getConnection(); Statement stm = con.createStatement(); stm.execute("Select 1"); Thanks, Pavan -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org