Return-Path: Delivered-To: apmail-cayenne-commits-archive@www.apache.org Received: (qmail 68759 invoked from network); 9 Mar 2007 12:33:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Mar 2007 12:33:08 -0000 Received: (qmail 65040 invoked by uid 500); 9 Mar 2007 12:33:16 -0000 Delivered-To: apmail-cayenne-commits-archive@cayenne.apache.org Received: (qmail 65029 invoked by uid 500); 9 Mar 2007 12:33:16 -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 65020 invoked by uid 99); 9 Mar 2007 12:33:16 -0000 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Mar 2007 04:33:16 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 94A381A983A; Fri, 9 Mar 2007 04:32:17 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r516391 - in /cayenne/main/branches/STABLE-2.0/cayenne: cayenne-java/src/cayenne/java/org/apache/cayenne/access/DataDomain.java cayenne-other/release-notes/RELEASE-NOTES-2.0-SNAPSHOT.txt Date: Fri, 09 Mar 2007 12:32:17 -0000 To: commits@cayenne.apache.org From: aadamchik@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070309123217.94A381A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: aadamchik Date: Fri Mar 9 04:32:16 2007 New Revision: 516391 URL: http://svn.apache.org/viewvc?view=rev&rev=516391 Log: CAY-765 Programmatically overriding "use share cache" fails - 2.0 fix Modified: cayenne/main/branches/STABLE-2.0/cayenne/cayenne-java/src/cayenne/java/org/apache/cayenne/access/DataDomain.java cayenne/main/branches/STABLE-2.0/cayenne/cayenne-other/release-notes/RELEASE-NOTES-2.0-SNAPSHOT.txt Modified: cayenne/main/branches/STABLE-2.0/cayenne/cayenne-java/src/cayenne/java/org/apache/cayenne/access/DataDomain.java URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-java/src/cayenne/java/org/apache/cayenne/access/DataDomain.java?view=diff&rev=516391&r1=516390&r2=516391 ============================================================================== --- cayenne/main/branches/STABLE-2.0/cayenne/cayenne-java/src/cayenne/java/org/apache/cayenne/access/DataDomain.java (original) +++ cayenne/main/branches/STABLE-2.0/cayenne/cayenne-java/src/cayenne/java/org/apache/cayenne/access/DataDomain.java Fri Mar 9 04:32:16 2007 @@ -303,7 +303,8 @@ /** * Returns true if DataContexts produced by this DataDomain are using * shared DataRowStore. Returns false if each DataContext would work - * with its own DataRowStore. + * with its own DataRowStore. Note that this setting can be overwritten per + * DataContext. See {@link #createDataContext(boolean)}. */ public boolean isSharedCacheEnabled() { return sharedCacheEnabled; @@ -383,7 +384,7 @@ /** * Returns snapshots cache for this DataDomain, lazily initializing it on the first - * call. + * call if 'sharedCacheEnabled' flag is true. */ public synchronized DataRowStore getSharedSnapshotCache() { if (sharedSnapshotCache == null && sharedCacheEnabled) { @@ -392,6 +393,21 @@ return sharedSnapshotCache; } + + /** + * Returns a guaranteed non-null shared snapshot cache regardless of the + * 'sharedCacheEnabled' flag setting. This allows to build DataContexts that do not + * follow the default policy. + * + * @since 3.0 + */ + synchronized DataRowStore nonNullSharedSnapshotCache() { + if (sharedSnapshotCache == null) { + this.sharedSnapshotCache = new DataRowStore(name, properties, eventManager); + } + + return sharedSnapshotCache; + } /** * Shuts down the previous cache instance, sets cache to the new DataSowStore instance @@ -552,7 +568,7 @@ // for new dataRowStores use the same name for all stores // it makes it easier to track the event subject DataRowStore snapshotCache = (useSharedCache) - ? getSharedSnapshotCache() + ? nonNullSharedSnapshotCache() : new DataRowStore(name, properties, eventManager); DataContext context; Modified: cayenne/main/branches/STABLE-2.0/cayenne/cayenne-other/release-notes/RELEASE-NOTES-2.0-SNAPSHOT.txt URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-other/release-notes/RELEASE-NOTES-2.0-SNAPSHOT.txt?view=diff&rev=516391&r1=516390&r2=516391 ============================================================================== --- cayenne/main/branches/STABLE-2.0/cayenne/cayenne-other/release-notes/RELEASE-NOTES-2.0-SNAPSHOT.txt (original) +++ cayenne/main/branches/STABLE-2.0/cayenne/cayenne-other/release-notes/RELEASE-NOTES-2.0-SNAPSHOT.txt Fri Mar 9 04:32:16 2007 @@ -20,6 +20,8 @@ CAY-751 AS400 datafields containing # in field names do not get mapped correctly CAY-752 Importing EOModel gives Cast Exception CAY-754 Local jNDI hack breaks when running with Jetty6-Maven +CAY-764 Exception when importing an EOModel with single table inheritance +CAY-765 Programmatically overriding "use share cache" fails ---------------------------------- Release: 2.0.2