CDO understanding commit conflicts [message #1832743] |
Thu, 24 September 2020 05:53  |
Eclipse User |
|
|
|
The code below will create a LocalCommitConflictException on the commit for trans2.
I would like to understand why this is.
The resource for path2 is not touched anymore by trans1 after the initial commit.
I think this is something specific to resource deletions? If I simply change the content of path2 then everything seems to be fine.
CDOTransaction trans = cdoSession.openTransaction();
CDOTransaction trans2 = cdoSession.openTransaction();
try {
String path1 = "/path1";
String path2 = "/path2";
final CDOResource res = trans.createResource(path1);
trans.commit();
res.setPath(path2);
trans.commit();
trans2.getResource(path2).delete(null);
trans.createResource("/someotherpath");
trans.commit();
trans2.commit(); // <<<<<<<<<< commit conflict here
} finally {
trans.close();
trans2.close();
}
;
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03506 seconds