Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
core 1.4.5
-
None
-
None
-
Windows Vista, Java 1.5.0, Derby Database for versioning and workspace, JUnit 4 Testcase
Description
- Open a transaction
- Add a new versionable node and check it in
- Save the uuid of the version node returned by node.checkin()
- Rollback transaction AND call session.refresh(false)
- access version node by session.getNodeByUUID()
==> in spite of the rollback the version node is still found. If the path of the version node is used to look it up (session.getItem()), it fails
The following JUnit 4 test case demonstrates the problem:
@Test
public void testRollbackInline() throws Exception
private boolean hasVersionFails(String versionId) throws RepositoryException {
boolean hasVersion;
try
catch (ItemNotFoundException e)
{ hasVersion = false; }if (hasVersion)
System.err.println("hasVersionFailing: " + versionId + " ==> FOUND");
else
System.err.println("hasVersionFailing: " + versionId + " ==> NOT FOUND");
return hasVersion;
}
private boolean hasVersionWorks(String versionId) throws RepositoryException {
boolean hasVersion;
try { Node nodeByUUID = superuser.getNodeByUUID(versionId); String path = nodeByUUID.getPath(); hasVersion = superuser.itemExists(path); } catch (ItemNotFoundException e) { hasVersion = false; }
if (hasVersion)
System.err.println("hasVersionWorking: " + versionId + " ==> FOUND");
else
System.err.println("hasVersionWorking: " + versionId + " ==> NOT FOUND");
return hasVersion;
}
I will try to attach the complete test sources, which also shows the setup of the repository, though I did nothing special there.
Attachments
Attachments
Issue Links
- duplicates
-
JCR-630 Versioning operations are not fully transactional
- Open