Details
-
Task
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
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.