cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkazimirc...@apache.org
Subject svn commit: r1147170 - /cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
Date Fri, 15 Jul 2011 14:49:46 GMT
Author: dkazimirchyk
Date: Fri Jul 15 14:49:46 2011
New Revision: 1147170

URL: http://svn.apache.org/viewvc?rev=1147170&view=rev
Log:
CAY-1583 context.getObjectStore() returning null causing NullpointerException in DataMergeHandler

initializing objectStore before attaching context to parent channel
fix for 3.0

Modified:
    cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java

Modified: cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java?rev=1147170&r1=1147169&r2=1147170&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
(original)
+++ cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
Fri Jul 15 14:49:46 2011
@@ -199,14 +199,17 @@ public class DataContext extends BaseCon
      * @since 1.2
      */
     public DataContext(DataChannel channel, ObjectStore objectStore) {
-        // use a setter to properly initialize EntityResolver
-        setChannel(channel);
 
         // inject self as parent context
         if (objectStore != null) {
             this.objectStore = objectStore;
             objectStore.setContext(this);
+        }
+        
+        // use a setter to properly initialize EntityResolver
+        setChannel(channel);
 
+        if (objectStore != null) {
             DataDomain domain = getParentDataDomain();
             this.usingSharedSnaphsotCache = domain != null
                     && objectStore.getDataRowCache() == domain.getSharedSnapshotCache();



Mime
View raw message