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

refresh(PESSIMISTIC_WRITE) generates seperate SQL for the lock

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.2, 2.2.1.1, 2.2.3, 2.3.0, 2.4.0
    • 2.1.2, 2.2.1.1, 2.2.3, 2.4.0
    • jdbc, kernel
    • None
    • 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

        1. OPENJPA-2449.patch
          2 kB
          Albert Lee

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: