1. Cayenne
  2. CAY-1682

Remove EntityResolver synchronizations


    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.1M3
    • Fix Version/s: None
    • Component/s: Core Library
    • Labels:
    • Environment:
      This affects all versions of Cayenne. The fix should go either in 3.1 or 3.2


      EntityResolver contents normally don't change in runtime, yet it has a bunch of synchronized methods - lookupObjEntity, getClassDescriptor(), etc. (Surprisingly 'getObj/DbEntity' is not synchronized). All these methods are invoked very frequently and create contention points in highly concurrent apps. IIRC historically these methods were added for the benefit of the Modeler (as a user might add/remove DataMaps, and change their contents all the time).

      The goal of this task is to provide a simple and efficient EntityResolver for the runtime.

      However it may require deep refactoring which may push it to 3.2 release. Specifically:

      1. Split the uses of EntityResolver between the Modeler and runtime (it is generally easy based on MappingNamespace interface, except when we are calling EJBQL validation API that requires EntityResolver)

      2. Prevent DataMap from looking for objects in the parent namespace. This is confusing and was probably done for the modeler benefit too.

      3. Remove DataMap change events (probably will require a special DataMap implementation for the Modeler that has those events)

      4. Remove EntityResolver on-demand compilation features. If a user wants to change the mapping dynamically, it is probably safer and more efficient to create a new EntityResolver from scratch.

        Issue Links


          No work has yet been logged on this issue.


            • Assignee:
              Andrus Adamchik
              Andrus Adamchik
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: