Il 23.10.2014 01.49, Christopher Schultz ha scritto:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Alessandro,

On 10/22/14 1:04 PM, Alessandro Manzoni wrote:
I configured a Resource datasouce inside context.xml but the
resulting connection is misconfigured.

The failing attribute appears as:

connectionProperties="sort=table;sort table=QSYS/QASCII"

but looking at the connection (while debugging) properties are
messed up, instead of the above 2 properties I see only 1:

sort=table=QSYS/QASCII

It looks like the property "sort table", with a blank inside the
name, was not correctly parsed.
It sure does.

I'm using jtOpen.jar AS400JDBCDriver that supports a lot of such
strange property names:
http://www-01.ibm.com/support/knowledgecenter/api/content/ssw_ibm_i_61/rzahh/javadoc/com/ibm/as400/access/doc-files/JDBCProperties.html
Aah,
AS/400. You are a barrel of laughs.

If I try supplying the same properties using the
connect(Properties) method, or appending them to the url, all is
fine.

Is there some special syntax to achieve my goal?
I think this is likely a bug.

Whose bug it is depends upon which connection pool you are using. Are
you using Tomcat's default pool (based upon commons-dbcp) or
tomcat-pool. If you don't know, it's probably the former.

If the bug belongs to commons-dbcp, you should report it over there
and when it gets fixed, we'll consume the changes and then Tomcat
should work properly.

What version of Tomcat are you using?
I did nothing but inserting a <Resource element into context.xml with no factory declared, so I think it's Tomcat's default pool fault:
    <Resource name="jdbc/OmniaWebDB2400Pool" auth="Container"
type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000"
        username="USER" password="PASS"
        driverClassName="com.ibm.as400.access.AS400JDBCDriver"
        connectionProperties="sort=table;sort table=QSYS/QASCII;"
        url="jdbc:as400://dbserver/SCHEMA" />


I tried both 6.037 and 7.056 versions with the same result.

Itried 8.014 too, but the prgram stops, just while getting the connection from the datasource, datasource.getConnection() method, with this stack trace:

java.lang.AbstractMethodError: com.ibm.as400.access.AS400JDBCConnection.isValid(I)Z org.apache.tomcat.dbcp.dbcp2.DelegatingConnection.isValid(DelegatingConnection.java:913) org.apache.tomcat.dbcp.dbcp2.PoolableConnection.validate(PoolableConnection.java:226) org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:302) org.apache.tomcat.dbcp.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2165) org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2148) org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:1902) org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1412)

even if I didn't declare any validate query in datasource definition.

Basing upon AS400JDBCConnection docs, it's implementing java.sql.Connection interface from JDK 1.4.2, where there was no isValid() method. Maybe this is possibly a bug too, in the sense that org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory could take in account the driver version before validating it, or cathing AbstractMethodError, that's telling that the method is not there.
By the way I cannot test tomcat 8.014 at all.

Thanks + best regards.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to