This is an automated email from the ASF dual-hosted git repository.
ntimofeev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git
The following commit(s) were added to refs/heads/master by this push:
new 0d29a32 Add failing test for using a nested context with a two-stage
commit
new caeb4b4 Merge pull request #458 from
johnthuss/nestedTwoStageCommitFailure
0d29a32 is described below
commit 0d29a32ff98b7af1a1149d47aba10bedec38024e
Author: John Huss <[email protected]>
AuthorDate: Fri May 17 13:53:16 2019 -0500
Add failing test for using a nested context with a two-stage commit
This one is strange. It seems to work correctly on older versions, but not
all the time, maybe 25% only. But it seems to always fail now.
In any case, I would expect this operation to always succeed.
---
.../apache/cayenne/access/NestedDataContextWriteIT.java | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git
a/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextWriteIT.java
b/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextWriteIT.java
index dbca1ed..73b8e7f 100644
---
a/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextWriteIT.java
+++
b/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextWriteIT.java
@@ -43,6 +43,7 @@ import org.apache.cayenne.unit.di.server.CayenneProjects;
import org.apache.cayenne.unit.di.server.ServerCase;
import org.apache.cayenne.unit.di.server.UseServerRuntime;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;
@@ -656,4 +657,18 @@ public class NestedDataContextWriteIT extends ServerCase {
assertEquals(artist.getPaintingArray().get(0).getObjectContext(),
context);
}
+
+ @Test
+ @Ignore("Waiting for a fix")
+ public void testTwoStageCommit() {
+ DataContext parent = createDataContext();
+ ObjectContext child = runtime.newContext(parent);
+
+ Painting painting = child.newObject(Painting.class);
+ painting.setPaintingTitle("222");
+
+ child.commitChangesToParent();
+ parent.commitChanges();
+ assertTrue(!painting.getObjectId().isTemporary());
+ }
}