You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Albert Lee (JIRA)" <ji...@apache.org> on 2013/11/05 19:33:17 UTC
[jira] [Updated] (OPENJPA-2449) refresh(PESSIMISTIC_WRITE)
generates seperate SQL for the lock
[ https://issues.apache.org/jira/browse/OPENJPA-2449?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Albert Lee updated OPENJPA-2449:
--------------------------------
Attachment: OPENJPA-2449.patch
> refresh(PESSIMISTIC_WRITE) generates seperate SQL for the lock
> --------------------------------------------------------------
>
> Key: OPENJPA-2449
> URL: https://issues.apache.org/jira/browse/OPENJPA-2449
> Project: OpenJPA
> Issue Type: Improvement
> Components: jdbc, kernel
> Affects Versions: 2.1.2, 2.2.1.1, 2.2.3, 2.3.1, 2.4.0
> Reporter: Albert Lee
> Priority: Minor
> Attachments: OPENJPA-2449.patch
>
>
> Simple refresh(PESSIMISTIC_WRITE) generates multiple SQL statements. E.g.
> em.refresh(t1, LockModeType.PESSIMISTIC_WRITE);
> //SELECT t0.CMLT_FOLDER_CONTEXT_UPDATE_TMS, t0.CRE_TIME FROM T1 t0 WHERE t0.c1 = ? [params=(String) c1]
> //SELECT t0.c1 FROM T1 t0 WHERE t0.c1 = ? FOR READ ONLY WITH RR USE AND KEEP UPDATE LOCKS [params=(String) c1]
> It would be nice if a single SQL is executed to optimize SQL execution and chances that another thread may compete to lock the same row.
--
This message was sent by Atlassian JIRA
(v6.1#6144)