cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r611585 - in /cayenne/main/trunk: docs/doc/src/main/resources/RELEASE-NOTES.txt framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
Date Sun, 13 Jan 2008 15:46:29 GMT
Author: aadamchik
Date: Sun Jan 13 07:46:28 2008
New Revision: 611585

URL: http://svn.apache.org/viewvc?rev=611585&view=rev
Log:
CAY-716 DataContext.rollbackChangesLocally() is not implemented for nested DataContexts

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java

Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=611585&r1=611584&r2=611585&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Sun Jan 13 07:46:28 2008
@@ -15,6 +15,7 @@
 Changes/New Features Since M2:
 
 CAY-263 cdbgen (DbGeneratorTask) must support classpath and classpathref
+CAY-716 DataContext.rollbackChangesLocally() is not implemented for nested DataContexts
 CAY-735 Embeddable class support in the org.apache.cayenne.map package
 CAY-736 Embeddable class support by Cayenne runtime
 CAY-879 Storing lifecycle listeners and callbacks in the *.map.xml and loading them back

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java?rev=611585&r1=611584&r2=611585&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
Sun Jan 13 07:46:28 2008
@@ -1020,11 +1020,11 @@
      */
     // TODO: Andrus, 1/19/2006: implement for nested DataContexts
     public void rollbackChangesLocally() {
-        if (getChannel() instanceof DataDomain) {
-            rollbackChanges();
-        }
-        else {
-            throw new CayenneRuntimeException("Implementation pending.");
+        if (objectStore.hasChanges()) {
+            GraphDiff diff = getObjectStore().getChanges();
+
+            getObjectStore().objectsRolledBack();
+            fireDataChannelRolledback(this, diff);
         }
     }
 
@@ -1047,6 +1047,12 @@
             getObjectStore().objectsRolledBack();
             fireDataChannelRolledback(this, diff);
         }
+        else {
+            if (channel != null) {
+                channel.onSync(this, new CompoundDiff(), DataChannel.ROLLBACK_CASCADE_SYNC);
+            }
+        }
+
     }
 
     /**



Mime
View raw message