You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (JIRA)" <ji...@apache.org> on 2011/07/08 09:23:16 UTC

[jira] [Created] (CAY-1586) New extension point: a strategy for retaining objects in the ObjectStore

New extension point: a strategy for retaining objects in the ObjectStore
------------------------------------------------------------------------

                 Key: CAY-1586
                 URL: https://issues.apache.org/jira/browse/CAY-1586
             Project: Cayenne
          Issue Type: Task
          Components: Core Library
    Affects Versions: 3.1M2
            Reporter: Andrus Adamchik


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);
}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (CAY-1586) New extension point: a strategy for retaining objects in the ObjectStore

Posted by "Dzmitry Kazimirchyk (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1586?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dzmitry Kazimirchyk closed CAY-1586.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 3.1M3
         Assignee: Dzmitry Kazimirchyk

Added injectable ObjectMapRetainStrategy which can be configured via RuntimeProperties to use weak,soft or hard references to objects in the ObjectStore.
Now it can be defined through 'org.apache.cayenne.context_object_retain_strategy' property with possible values: 'weak', 'soft', 'hard'. If it's not specified weak references are chosen by default.

> New extension point: a strategy for retaining objects in the ObjectStore
> ------------------------------------------------------------------------
>
>                 Key: CAY-1586
>                 URL: https://issues.apache.org/jira/browse/CAY-1586
>             Project: Cayenne
>          Issue Type: Task
>          Components: Core Library
>    Affects Versions: 3.1M2
>            Reporter: Andrus Adamchik
>            Assignee: Dzmitry Kazimirchyk
>             Fix For: 3.1M3
>
>
> 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);
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira