ODE
  1. ODE
  2. ODE-628

Some DBMS (like Ingres) don't support update on queries with join, we have to use subqueries instead

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.3
    • Component/s: BPEL Runtime
    • Labels:
      None
    • Environment:
      BPMS 6.0 beta2

      Description

      There's at least one place where we have error during runtime if we use Hibernate on Ingres for persistance: class org.apache.ode.daohib.bpel.CorrelatorDaoImpl. The query "from HCorrelatorSelector as hs where hs.processType = :processType and hs.correlator.correlatorId = :correlatorId" used in this class makes Hibernate to implicitly generate SQL with join for update.

      Unfortunately some DBMS (like Ingres for instance) do not support update for queries with JOIN. The workaround is to exlicitly define HQL with subquery instead:
      "from HCorrelatorSelector as hs where hs.processType = :processType and hs.correlatorId = (select hc.id from HCorrelator hc where hc.correlatorId = :correlatorId)"

      In cases like that we need dynamically define which HQL to use, i.e. we need to know which kind of DBMS we are running under. The definitive indicator is dialect (instance of org.hibernate.dialect.Dialect) is set for the current Session. We don't have possiblity now to access Session properties (all indicators are private fields). We should add some indicator which would be dynamically accessible for assessment.

        Activity

        Oleg Zenzin created issue -
        Hide
        Oleg Zenzin added a comment -

        Attached dao-hibernate.patch is the patch to be applied to dao-hibernate module to resolve this issue.

        Show
        Oleg Zenzin added a comment - Attached dao-hibernate.patch is the patch to be applied to dao-hibernate module to resolve this issue.
        Oleg Zenzin made changes -
        Field Original Value New Value
        Attachment dao-hibernate.patch [ 12411734 ]
        Hide
        Matthieu Riou added a comment -

        Patch applied. Thanks!

        Show
        Matthieu Riou added a comment - Patch applied. Thanks!
        Matthieu Riou made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Matthieu Riou [ mriou ]
        Fix Version/s 1.3.3 [ 12313905 ]
        Resolution Fixed [ 1 ]
        Matthieu Riou committed 802890 (1 file)

          People

          • Assignee:
            Matthieu Riou
            Reporter:
            Oleg Zenzin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development