[
https://issues.apache.org/jira/browse/OPENJPA-2350?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Richard Zowalla resolved OPENJPA-2350.
--------------------------------------
Resolution: Fixed
Already fixed on master: 6591d4d46 (OPENJPA-2557, on master) refuses to cache
unless every PK column is among the buffer's parameter columns
(FinderQueryImpl.java:82-88). The reported SQL has only a TECH_CLSTYP parameter
and BOID IS NULL, so it is no longer cached. Closing; please reopen if this
still happens with OpenJPA 4.x.
> 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
> Priority: Major
>
> 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 was sent by Atlassian Jira
(v10.3.26#10030026)