Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-1831

CayenneRuntime.getContext - replace with newContext

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.2.M1
    • None
    • None

    Description

      Unlike other CayenneRuntime "getXyz" methods that return singletons (where "get" prefix is justified), "getContext" is creating a new context on every call. We need more apt naming, such as "newContext".

      In fact I thought about this inconsistency initially when designing CayenneRuntime, but left it like that on assumption that CayenneRuntime will be managing its ObjectContexts scope. So in some situations it would return the same context multiple times. In practice managing OC scopes is always done outside Cayenne DI, and it should not normally try to interfere here. So this renaming will reduce confusion about the behavior of the method.

      Attachments

        Activity

          People

            andrus Andrus Adamchik
            andrus Andrus Adamchik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: