Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-51

Support optimized "/* ping */" queries as in Connector/J

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.1.3
    • Fix Version/s: 1.1.8
    • Component/s: Other
    • Labels:
      None

      Description

      Connector/J supports an optimized "/* ping */" query for validating a
      connection when you retrieve a connection out of a connection
      pool. This allows you to perform a ping operation at the mysql
      protocol layer, without having to actually execute a query like
      "select 1" (which in heavy applications may be too much
      overhead). This is also documented in a presentation that Mark
      Matthews once gave about high-performance with Connector/J, but I
      can't seem to find that presentation right now.

      This is documented in:

      http://dev.mysql.com/doc/refman/5.5/en/connector-j-usagenotes-j2ee-concepts-connection-pooling.html

      This is something that you would typically use in validationQuery
      parameter in a Tomcat DataSource, but unfortunately, they didn't put
      it like that in the Connector/J manual

      http://dev.mysql.com/doc/refman/5.5/en/connector-j-usagenotes-tomcat.html

      The attached patch implements this also in the MariaDB Java
      Client. The patch is sufficient to make this work for the data sources
      that I use:

      • JBoss 4.0.5
      • Apache Commons Database Pool (DBCP) 1.4. DBCP is also the underlying
        connection pool library in Tomcat.

      The patch does not implement this optimization for prepared
      statements, only for normal statements.

        Attachments

          Activity

            People

            • Assignee:
              diego dupin diego dupin
              Reporter:
              dverstap Davy Verstappen
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: