Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2449

refresh(PESSIMISTIC_WRITE) generates seperate SQL for the lock

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.2, 2.2.1.1, 2.2.3, 2.3.0, 2.4.0
    • Fix Version/s: 2.1.2, 2.2.1.1, 2.2.3, 2.4.0
    • Component/s: jdbc, kernel
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jpaheath Heath Thomann
                Reporter:
                allee8285 Albert Lee
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: