OpenJPA
  1. OpenJPA
  2. OPENJPA-1765

TableGenerator doesn't properly utilize all keys when under heavy stress.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0, 2.1.0
    • Fix Version/s: 2.0.2, 2.1.0
    • Component/s: jdbc
    • Labels:
      None

      Description

      TableJDBCSeq has a locking problem where multiple threads can run on top of each other resulting in all keys not being used for a given sequence.

      While unit testing a fix I also uncovered another theoretical start up problem where multiple threads can try to insert the same row into the DB resulting in a duplicate key exception.

        Issue Links

          Activity

          Hide
          Rick Curtis added a comment -

          @Milosz - Yes I believe so.

          Show
          Rick Curtis added a comment - @Milosz - Yes I believe so.
          Hide
          Michael Dick added a comment -

          Looks similar, but I think it's different. Can OPENJPA-1372 be reproduced without sharing the EM between threads?

          The added locking in this fix will prevent two EMs from getting the same sequences, I'm not sure about a single thread using the same EM. Might be worth running the test from 1372 to see if it still fails.

          Show
          Michael Dick added a comment - Looks similar, but I think it's different. Can OPENJPA-1372 be reproduced without sharing the EM between threads? The added locking in this fix will prevent two EMs from getting the same sequences, I'm not sure about a single thread using the same EM. Might be worth running the test from 1372 to see if it still fails.
          Hide
          Milosz Tylenda added a comment -

          Rick, is the theoretical problem the same as OPENJPA-1372?

          Show
          Milosz Tylenda added a comment - Rick, is the theoretical problem the same as OPENJPA-1372 ?
          Hide
          Rick Curtis added a comment -

          Committed revision 984943 to trunk.

          Show
          Rick Curtis added a comment - Committed revision 984943 to trunk.

            People

            • Assignee:
              Rick Curtis
              Reporter:
              Rick Curtis
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development