Author: aadamchik
Date: Thu Mar 1 08:30:11 2012
New Revision: 1295467
URL: http://svn.apache.org/viewvc?rev=1295467&view=rev
Log:
CAY-1680 Get rid of shared locks in DataDomain metadata lookups
unlocking cache getter for good measure
Modified:
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomain.java
Modified:
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomain.java
URL:
http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomain.java?rev=1295467&r1=1295466&r2=1295467&view=diff
==============================================================================
---
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomain.java
(original)
+++
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomain.java
Thu Mar 1 08:30:11 2012
@@ -342,9 +342,9 @@ public class DataDomain implements Query
* Returns snapshots cache for this DataDomain, lazily initializing it on
the first
* call if 'sharedCacheEnabled' flag is true.
*/
- public synchronized DataRowStore getSharedSnapshotCache() {
+ public DataRowStore getSharedSnapshotCache() {
if (sharedSnapshotCache == null && sharedCacheEnabled) {
- this.sharedSnapshotCache = new DataRowStore(name, properties,
eventManager);
+ this.sharedSnapshotCache = nonNullSharedSnapshotCache();
}
return sharedSnapshotCache;
@@ -352,10 +352,7 @@ public class DataDomain implements Query
/**
* 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
+ * 'sharedCacheEnabled' flag setting.
*/
synchronized DataRowStore nonNullSharedSnapshotCache() {
if (sharedSnapshotCache == null) {