You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ode.apache.org by "Oleg Zenzin (JIRA)" <ji...@apache.org> on 2009/06/24 00:53:08 UTC

[jira] Created: (ODE-628) Some DBMS (like Ingres) don't support update on queries with join, we have to use subqueries instead

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

                 Key: ODE-628
                 URL: https://issues.apache.org/jira/browse/ODE-628
             Project: ODE
          Issue Type: Improvement
          Components: BPEL Runtime
         Environment: BPMS 6.0 beta2
            Reporter: Oleg Zenzin


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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ODE-628) Some DBMS (like Ingres) don't support update on queries with join, we have to use subqueries instead

Posted by "Oleg Zenzin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ODE-628?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Zenzin updated ODE-628:
----------------------------

    Attachment: dao-hibernate.patch

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

> Some DBMS (like Ingres) don't support update on queries with join, we have to use subqueries instead
> ----------------------------------------------------------------------------------------------------
>
>                 Key: ODE-628
>                 URL: https://issues.apache.org/jira/browse/ODE-628
>             Project: ODE
>          Issue Type: Improvement
>          Components: BPEL Runtime
>         Environment: BPMS 6.0 beta2
>            Reporter: Oleg Zenzin
>         Attachments: dao-hibernate.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (ODE-628) Some DBMS (like Ingres) don't support update on queries with join, we have to use subqueries instead

Posted by "Matthieu Riou (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ODE-628?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthieu Riou resolved ODE-628.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3.3
         Assignee: Matthieu Riou

Patch applied. Thanks!

> Some DBMS (like Ingres) don't support update on queries with join, we have to use subqueries instead
> ----------------------------------------------------------------------------------------------------
>
>                 Key: ODE-628
>                 URL: https://issues.apache.org/jira/browse/ODE-628
>             Project: ODE
>          Issue Type: Improvement
>          Components: BPEL Runtime
>         Environment: BPMS 6.0 beta2
>            Reporter: Oleg Zenzin
>            Assignee: Matthieu Riou
>             Fix For: 1.3.3
>
>         Attachments: dao-hibernate.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.