You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2011/09/02 12:56:26 UTC

DO NOT REPLY [Bug 51756] New: Tomcat JDBC Pool does not work with Sybase

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.rangavajhala@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 51756] Tomcat JDBC Pool does not work with Sybase

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51756

--- Comment #1 from Filip Hanik <fh...@apache.org> 2011-09-02 17:18:44 UTC ---
what's the value of 'driverURL'? most likely this one is not correct. there is
nothing magic calling Driver.connect, if this call is failing. could be a
version thing on the URL itself.

Connect SQL 7.0
jdbc:jtds:sqlserver://ServerAddress/DBName;instance=;TDS=5.0
Connect SQL 6.5
jdbc:jtds:sqlserver://ServerAddress/DBName;instance=;TDS=4.2 

what I would like for you to do is in plain Java

Properties p = new Properties();
p.put("user",username);
p.put("password", password);
Driver driver =
(Driver)Class.forName("net.sourceforge.jtds.jdbc.Driver").newInstance();
driver.connect(driverUrl, p);

It should yield the exact same error if you don't change any of the variables.

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 51756] Question on driver URL Tomcat JDBC Pool with Sybase

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51756

windson.rangavajhala@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Tomcat JDBC Pool does not   |Question on driver URL
                   |work with Sybase            |Tomcat JDBC Pool with
                   |                            |Sybase

--- Comment #2 from windson.rangavajhala@gmail.com 2011-09-05 10:25:21 UTC ---
hi

Thanks for taking your time to look at this error. I got the issue resolved.
Our db server expects appName and processId for connection, which were not
getting passed correctly. I appended them to the driver URL and it worked fine.
Please close this request for now. I am changing the subject accordingly.
Please feel free to change as per your convenience.

Thanks!

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 51756] Question on driver URL Tomcat JDBC Pool with Sybase

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51756

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org