Cayenne
  1. Cayenne
  2. CAY-1487

Access to ObjectStore.objectMap not thread safe when creating new object instance (and processing snaphot events)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0 branch
    • Fix Version/s: 2.0.5
    • Component/s: Core Library
    • Labels:
      None

      Description

      The method ObjectStore.registerNode(..) is not synchronized, while getNode(..) is. The objectMap can be accessed in a thread-unsafe way when a new object instance is created and when at the same time snapshotevents are processed.

      When creating the instance, the unsafe registerNode method is used. It will start looping in the objectMap when at the same time when an EventDispatch thread tries to acces the objectMap through getNode(). The dispatch threads will go in a WAIT state which eventually results in a completely frozen application.

      I noticed that in cayenne 3 the registerNode() method is synchronized. Can such a fix also be applied to a cayenne 2.0.5 release?

        Activity

        Andrus Adamchik made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 2.0.5 [ 12313753 ]
        Resolution Fixed [ 1 ]
        Donald Vrakking created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Donald Vrakking
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development