OpenJPA
  1. OpenJPA
  2. OPENJPA-2104

BindParameter is not a valid query parameter as processed in DBDictionary's setUnknown()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.2.0
    • Component/s: jdbc
    • Labels:
      None

      Description

      After introduction of BindParameter, I am getting the following exception:

      <error message="The specified parameter of type "class org.apache.openjpa.jdbc.sql.BindParameter" is not a valid query parameter." type="org.apache.openjpa.persistence.ArgumentException">
      <openjpa-2.2.0-SNAPSHOT-r422266:1226933 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: The specified parameter of type "class org.apache.openjpa.jdbc.sql.BindParameter" is not a valid query parameter.
      at org.apache.openjpa.jdbc.sql.DBDictionary.setUnknown(DBDictionary.java:1458)
      at com.ibm.ws.persistence.pdq.meta.PDQParameterHandler.handleSQLBuffer(PDQParameterHandler.java:59)
      at com.ibm.ws.persistence.pdq.meta.PDQBaseData.update(PDQBaseData.java:239)
      at com.ibm.ws.persistence.pdq.kernel.PDQJDBCStoreQuery.executeUpdate(PDQJDBCStoreQuery.java:61)
      at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.executeBulkOperation(JDBCStoreQuery.java:577)
      at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.executeDelete(JDBCStoreQuery.java:491)
      at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:789)
      at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1025)
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:865)
      at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:892)
      at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:574)
      at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:374)

      Looks like the setUnknown method needs to recognize the new BindParameter type, like Sized and Calendard:

      if (val instanceof Sized)

      { sized = (Sized) val; val = sized.value; }

      else if (val instanceof Calendard)

      { cald = (Calendard) val; val = cald.value; }

      and extract its actual value before call out to the setters.

        Issue Links

          Activity

          Albert Lee made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Albert Lee made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Albert Lee made changes -
          Assignee Albert Lee [ allee8285 ]
          Albert Lee made changes -
          Field Original Value New Value
          Link This issue is related to OPENJPA-2099 [ OPENJPA-2099 ]
          Albert Lee created issue -

            People

            • Assignee:
              Albert Lee
              Reporter:
              Albert Lee
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development