openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "usama rashwan (JIRA)" <j...@apache.org>
Subject [jira] [Created] (OPENJPA-2350) wrong cache in FinderCacheImpl
Date Tue, 12 Mar 2013 15:29:12 GMT
usama rashwan created OPENJPA-2350:
--------------------------------------

             Summary: wrong cache in FinderCacheImpl
                 Key: OPENJPA-2350
                 URL: https://issues.apache.org/jira/browse/OPENJPA-2350
             Project: OpenJPA
          Issue Type: Bug
    Affects Versions: 2.2.1
            Reporter: usama rashwan


when CascadeType.PERSIST is enabled the finder is generated with IS NULL on PK filed and cached
in FinderCacheImpl using the generated SQL with IS NULL Subsequent finder will use the cached
SQL even if PK value is assigned resulting in wrong sql execution 

Below in sample of SQL retrived from the cache after PK is assigned 

SELECT t1.TECH_CLSTYP, t1.TECH_LOCK, t1.MYORG_CREATION_DATE, t1.MYORG_CREATION_TIME, t1.MYORG_MODIF_DATE,
t1.MYORG_MODIF_TIME, t1.CREATION_DATE, t1.CURRENT_STATUS, t1.CURRENT_STATUS_DATE, t1.CURRENT_SUB_STATUS,
t1.ORG_BOID, t1.ORG_BOVERSION, t1.BIL_FIRST_DATE, t1.BIL_FREQUENCY_BOCD, t1.BOID, t1.END_DATE,
t1.MAX_NGINS, t1.MAX_USERS, t1.NEXT_BIL_DATE, t1.OPERATOR_BOID, t1.OPERATOR_BOVERSION, t1.SAP_CTRACT_NB,
t1.START_DATE FROM T_SBH_CTRACT t0, T_CTRACT t1 WHERE t1.TECH_CLSTYP = ? AND t0.BOID IS NULL
AND t0.BOID = t1.BOID

Parameters (1, 200821) is used for TECH_CLSTYP not for BOID (TECH_CLSTYP is DiscriminatorColumn
and BOID is PK )

the only workaround for now is by disabling SQL finder cache  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message