Mantis - Resin
Viewing Issue Advanced Details
1520 minor always 12-20-06 14:03 01-01-07 11:17
scruz  
ferg  
normal  
closed 3.0.19  
fixed  
none    
none 3.0.23  
0001520: MySQL init-params Not Being Applied
We noticed this problem with MySQL a couple of months ago, but I didn?t realize that the problem was Resin until now. Resin, having not applied the different driver settings, masked the problem of the MySQL server side prepared statements being broken.

Here is our database configuration from resin.conf:

  <database>
    <jndi-name>jdbc/MyDB</jndi-name>
    <driver>
      <type>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</type>
      <init-param autoReconnect="true" />
      <init-param autoReconnectForPools="true" />
      <init-param cacheResultSetMetadata="true" />
      <init-param dumpQueriesOnException="true" />
      <init-param elideSetAutoCommits="true" />
      <init-param explainSlowQueries="true" />
      <init-param failOverReadOnly="true" />
      <init-param isInteractiveClient="true" />
      <init-param jdbcCompliantTruncation="true" />
      <init-param logSlowQueries="true" />
      <init-param profileSQL="false" />
      <init-param slowQueryThresholdMillis="2500" />
      <init-param useFastIntParsing="true" />
      <init-param useServerPreparedStmts="true" />
      <init-param useTimezone="false" />
      <password>myPassword</password>
      <url>jdbc:mysql://myserver/mydb</url> [^]
      <user>myuser</user>
    </driver>
    <max-active-time>600s</max-active-time>
    <max-connections>35</max-connections>
    <max-idle-time>30s</max-idle-time>
    <max-pool-time>2400s</max-pool-time>
    <ping>true</ping>
    <ping-interval>60s</ping-interval>
    <ping-table>state</ping-table>
    <prepared-statement-cache-size>8</prepared-statement-cache-size>
    <xa>true</xa>
  </database>

All of the init-params are being overridden with the default values every time. More information on the issues can be found here:

http://www.nabble.com/MySQL-%3E5.0.18-and-Connector-J-5.0.4-weirdness-tf2827165.html [^]

I tried to attach a patch, but it won't let me.

Notes
(0001664)
scruz   
12-20-06 15:07   
OK, my wording was not correct in the issue description.

The problem is that the init-params are never applied for ConnectionPoolDataSource and MysqlXADataSource (in Resin's DriverConfig class). The fact that the URL params are overriden by the defaults is actually a bug in the MySQL driver.
(0001666)
ferg   
12-20-06 15:40   
server/450{0,1,2,3}