cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r516389 - in /cayenne/main/branches/STABLE-1.2/cayenne: cayenne-java/src/cayenne/java/org/objectstyle/cayenne/access/DataDomain.java cayenne-other/release-notes/RELEASE-NOTES-1.2.3.txt
Date Fri, 09 Mar 2007 12:30:18 GMT
Author: aadamchik
Date: Fri Mar  9 04:30:17 2007
New Revision: 516389

URL: http://svn.apache.org/viewvc?view=rev&rev=516389
Log:
CAY-765 Programmatically overriding "use share cache" fails - 1.2 fix

Modified:
    cayenne/main/branches/STABLE-1.2/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/access/DataDomain.java
    cayenne/main/branches/STABLE-1.2/cayenne/cayenne-other/release-notes/RELEASE-NOTES-1.2.3.txt

Modified: cayenne/main/branches/STABLE-1.2/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/access/DataDomain.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-1.2/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/access/DataDomain.java?view=diff&rev=516389&r1=516388&r2=516389
==============================================================================
--- cayenne/main/branches/STABLE-1.2/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/access/DataDomain.java
(original)
+++ cayenne/main/branches/STABLE-1.2/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/access/DataDomain.java
Fri Mar  9 04:30:17 2007
@@ -339,7 +339,8 @@
     /**
      * Returns <code>true</code> if DataContexts produced by this DataDomain
are using
      * shared DataRowStore. Returns <code>false</code> 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;
@@ -419,7 +420,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) {
@@ -428,6 +429,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
@@ -588,7 +604,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-1.2/cayenne/cayenne-other/release-notes/RELEASE-NOTES-1.2.3.txt
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-1.2/cayenne/cayenne-other/release-notes/RELEASE-NOTES-1.2.3.txt?view=diff&rev=516389&r1=516388&r2=516389
==============================================================================
--- cayenne/main/branches/STABLE-1.2/cayenne/cayenne-other/release-notes/RELEASE-NOTES-1.2.3.txt
(original)
+++ cayenne/main/branches/STABLE-1.2/cayenne/cayenne-other/release-notes/RELEASE-NOTES-1.2.3.txt
Fri Mar  9 04:30:17 2007
@@ -16,3 +16,5 @@
 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



Mime
View raw message