Return-Path: X-Original-To: apmail-cayenne-commits-archive@www.apache.org Delivered-To: apmail-cayenne-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B02B16D1D for ; Fri, 15 Jul 2011 09:56:39 +0000 (UTC) Received: (qmail 40679 invoked by uid 500); 15 Jul 2011 09:56:35 -0000 Delivered-To: apmail-cayenne-commits-archive@cayenne.apache.org Received: (qmail 40137 invoked by uid 500); 15 Jul 2011 09:56:28 -0000 Mailing-List: contact commits-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list commits@cayenne.apache.org Received: (qmail 39719 invoked by uid 99); 15 Jul 2011 09:56:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jul 2011 09:56:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jul 2011 09:56:21 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 0078558AD9 for ; Fri, 15 Jul 2011 09:56:00 +0000 (UTC) Date: Fri, 15 Jul 2011 09:55:59 +0000 (UTC) From: "Dzmitry Kazimirchyk (JIRA)" To: commits@cayenne.apache.org Message-ID: <1102259709.16749.1310723759997.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <108734969.10420.1310109796608.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Closed] (CAY-1586) New extension point: a strategy for retaining objects in the ObjectStore MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on 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