Details
-
Task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.1M2
-
None
Description
Currently ObjectStore.objectMap uses WEAK references to objects, often causing premature garbage collection of cached objects and extra queries on relationship resolving, etc. In many cases using SOFT (or HARD) retain strategy may be desirable. So I suggest to make it a configurable via DI.
To achieve that we can create a pluggable strategy class that is used whenever DataContext/ObjectStore are created. Should probably also deprecate the following ObjectStore constructors to reduce confusion:
public ObjectStore() {
this(null);
}
public ObjectStore(DataRowStore dataRowCache) {
this(dataRowCache, null);
}