OpenJPA
  1. OpenJPA
  2. OPENJPA-2131

Missing IN or OUT parameter exception with OracleDictionary

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.0.3, 2.1.2, 2.2.1.1, 2.2.3, 2.3.0
    • Component/s: jdbc
    • Labels:
      None
    • Environment:
      Windows with Oracle 11g
    • Patch Info:
      Patch Available

      Description

      We have generate query with

      Query q = em.createQuery("select e._name, e._id, sum(case when e._status=:pending then e._count else 0 end) from Exceptions e, Historty h where e._guid = :guid and .....
      then set paramenters for both :pending (in select) and :guid (in where), and call q.setMaxResults(100);

      with DB2, everything works fine, and DBDictionary.getSelects() and SQLBuffer.append() will invoke correctly and set parameter of :pending

      with Oracle implementation, OracleDictionary.getSelects(Select sel, boolean distinctIdentifiers, boolean forUpdate) will invoke and SQLBuffer.getSQL() get to call (as two if checks are not satisfied and gos to create a new SQLBuffer instance), but this time :pending parameter will missing to add to _param List,
      Eventually, we'll get Missing IN or OUT parameter exception from to execute query by preparedStatement

      This bug exist in both this branch and trunk.
      We have a work around, after SQLBuffer.getSQL() call, add some code to reset _param list.

      1. OPENJPA-2131.22x.patch
        3 kB
        Albert Lee
      2. OracleInOutParameterIssue.patch
        3 kB
        Zilin Chen

        Activity

        Zilin Chen created issue -
        Zilin Chen made changes -
        Field Original Value New Value
        Attachment OracleInOutParameterIssue.patch [ 12514711 ]
        Zilin Chen made changes -
        Patch Info Patch Available [ 10042 ]
        Albert Lee made changes -
        Assignee Albert Lee [ allee8285 ]
        Albert Lee made changes -
        Attachment OPENJPA-2131.22x.patch [ 12521344 ]
        Albert Lee made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.3.0 [ 12319463 ]
        Resolution Fixed [ 1 ]
        Heath Thomann made changes -
        Fix Version/s 2.0.3 [ 12317143 ]
        Fix Version/s 2.1.2 [ 12317142 ]
        Fix Version/s 2.2.1.1 [ 12323484 ]
        Fix Version/s 2.2.3 [ 12324305 ]
        Mark Struberg made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development