Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1197

NativeQueries fail with MySQL

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0.3, 1.2.1
    • 1.0.4, 1.2.2, 1.3.0, 2.0.0-beta
    • None
    • None

    Description

      The TestCase for DataCache included / excluded types relies on a NativeQuery to drop database tables at the end of the test. This fails with some versions of the MySQL JDBC driver.

      The exception from the testcase looks like this :
      <openjpa-1.0.4-SNAPSHOT-rexported nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Unable to retrieve metadata for procedure.
      at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:3964)
      at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:97)
      at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:83)
      at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:59)
      at org.apache.openjpa.jdbc.kernel.SQLStoreQuery$SQLExecutor.executeUpdate(SQLStoreQuery.java:242)

      <snip>
      Caused by: java.sql.SQLException: Unable to retrieve metadata for procedure.
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
      at com.mysql.jdbc.CallableStatement.extractProcedureName(CallableStatement.java:857)
      at com.mysql.jdbc.CallableStatement.determineParameterTypes(CallableStatement.java:692)
      at com.mysql.jdbc.CallableStatement.<init>(CallableStatement.java:513)
      at com.mysql.jdbc.Connection.parseCallableStatement(Connection.java:4422)
      at com.mysql.jdbc.Connection.prepareCall(Connection.java:4496)
      at com.mysql.jdbc.Connection.prepareCall(Connection.java:4470)
      at org.apache.commons.dbcp.DelegatingConnection.prepareCall(DelegatingConnection.java:212)

      Upgrading to a more recent version of the MySQL driver resolves these issues and allows the testcase to pass.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            mikedd Michael Dick
            mikedd Michael Dick
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment