Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3.2
    • Fix Version/s: 1.3.3rc1
    • Component/s: JDO
    • Labels:
      None
    • Number of attachments :
      6

      Description

      The ObjectLock class uses custom mechanism to implement the read/write locks, and it is too complicated and error-prone. This issue will try use the java.util.concurrent.locks.ReentrantReadWriteLock to refactor the ObjectLock class.

      1. objectlock_patch1.txt
        33 kB
        Wensheng Dou
      2. objectlock_patch2.txt
        34 kB
        Wensheng Dou
      3. patch-C3085-20110525.txt
        33 kB
        Ralf Joachim
      4. patch-C3085-20110526.txt
        22 kB
        Wensheng Dou
      5. patch-C3085-20110531.txt
        35 kB
        Wensheng Dou
      6. patch-C3085-20110728.txt
        6 kB
        Wensheng Dou

        Activity

        Hide
        Wensheng Dou added a comment -

        What has been done in patch-C3085-20110526.txt?
        (1) Extract the duplicated code in acquireLoadLock, acquireUpdateLock, update methods into a new method.

        Show
        Wensheng Dou added a comment - What has been done in patch-C3085-20110526.txt? (1) Extract the duplicated code in acquireLoadLock, acquireUpdateLock, update methods into a new method.
        Hide
        Ralf Joachim added a comment -

        Committed patch patch-C3085-20110526.txt with some minor code formatting.

        Show
        Ralf Joachim added a comment - Committed patch patch-C3085-20110526.txt with some minor code formatting.
        Hide
        Wensheng Dou added a comment - - edited

        What has been done in patch-C3085-20110531.txt?
        (1) Use ReetrantLock and Condition to instead of "synchronized, wait, notifyAll". The Condition will make the code more understandable.
        (2) Simplify the meaning of the property _delete. It means that if the object is deleted, than the _deleted is true forever.
        (3) Delete the property _waitCount, _waitCount can be replaced by Condition now.

        Show
        Wensheng Dou added a comment - - edited What has been done in patch-C3085-20110531.txt? (1) Use ReetrantLock and Condition to instead of "synchronized, wait, notifyAll". The Condition will make the code more understandable. (2) Simplify the meaning of the property _delete. It means that if the object is deleted, than the _deleted is true forever. (3) Delete the property _waitCount, _waitCount can be replaced by Condition now.
        Hide
        Wensheng Dou added a comment -

        Some cleanup for ObjectLock.
        (1) Modify the visibility of some methods
        (2) Delete _waitCount field
        (3) Modify the try-catch in delete()
        (4) MOdify some comments

        Show
        Wensheng Dou added a comment - Some cleanup for ObjectLock. (1) Modify the visibility of some methods (2) Delete _waitCount field (3) Modify the try-catch in delete() (4) MOdify some comments
        Hide
        Ralf Joachim added a comment -

        Once all subtask has been resolved we can also close this one.

        Show
        Ralf Joachim added a comment - Once all subtask has been resolved we can also close this one.

          People

          • Assignee:
            Wensheng Dou
            Reporter:
            Wensheng Dou
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: