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

moving some code outside of lock boundaries, that don't need to be locked

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.0.0-M2
    • None
    • slice
    • None

    Description

      I am reviewing code because of slices concurrency/multithreaded issues, and I see that some code in QueryImpl was too aggressive in their locks. So I reviewed QueryImpl and BrokerImpl...

      Mainly: assertMethods do not need to be within the lock.

      Then I found a few methods that were doing precondition/shortcut checking, but all within locks, so that seemed like a waste:

      1) QueryImpl.setCandiateExtent; checks to see if value setting is same as current value

      2) these places check to see if it needs to calculate the value of not:
      QueryImpl.isUnique, QueryImpl.setCandiateExtent, QueryImpl.getCandidateType, QueryImpl.getResultType, QueryImpl.getParameterDeclaration

      Attachments

        1. locks-asserts-2.diff
          10 kB
          Fernando Padilla
        2. locks-asserts.diff
          11 kB
          Fernando Padilla

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fern Fernando Padilla
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: