You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Dirk Feufel (JIRA)" <ji...@apache.org> on 2010/04/13 10:06:51 UTC

[jira] Created: (JCR-2602) Removal of first version throws javax.jcr.ReferentialIntegrityException

Removal of first version throws javax.jcr.ReferentialIntegrityException
-----------------------------------------------------------------------

                 Key: JCR-2602
                 URL: https://issues.apache.org/jira/browse/JCR-2602
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: versioning
    Affects Versions: 2.0.0
            Reporter: Dirk Feufel


A ReferentialIntegrityException occurs when I delete the first version succeeding the root version. Deleting other versions works fine. Here is the stack:

javax.jcr.ReferentialIntegrityException: Unable to remove version. At least once referenced.
        at org.apache.jackrabbit.core.version.InternalVersionHistoryImpl.removeVersion(InternalVersionHistoryImpl.java:379)
        at org.apache.jackrabbit.core.version.InternalVersionManagerBase.internalRemoveVersion(InternalVersionManagerBase.java:684)
        at org.apache.jackrabbit.core.version.InternalVersionManagerImpl$5.run(InternalVersionManagerImpl.java:495)
        at org.apache.jackrabbit.core.version.InternalVersionManagerImpl$DynamicESCFactory.doSourced(InternalVersionManagerImpl.java:760)
        at org.apache.jackrabbit.core.version.InternalVersionManagerImpl.removeVersion(InternalVersionManagerImpl.java:493)
        at org.apache.jackrabbit.core.version.InternalXAVersionManager.removeVersion(InternalXAVersionManager.java:264)
        at org.apache.jackrabbit.core.version.VersionHistoryImpl.removeVersion(VersionHistoryImpl.java:253)

The code is simple:

VersionHistory vh = session.getWorkspace().getVersionManager().getVersionHistory(path);
vh.removeVersion(version); // where version is the first version succeeding the root version



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JCR-2602) Removal of first version throws javax.jcr.ReferentialIntegrityException

Posted by "Dirk Feufel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859670#action_12859670 ] 

Dirk Feufel commented on JCR-2602:
----------------------------------

I am not certain. But the only action which is performed on the node is 

versionManager.checkout(path);
Version ver = versionManager.checkin(path);
versionManager.addVersionLabel(ver.getName(), ..., true);

And other versions than the first which are created the same way can be deleted. 

How could I resolve/delete such references?


> Removal of first version throws javax.jcr.ReferentialIntegrityException
> -----------------------------------------------------------------------
>
>                 Key: JCR-2602
>                 URL: https://issues.apache.org/jira/browse/JCR-2602
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: versioning
>    Affects Versions: 2.0.0
>            Reporter: Dirk Feufel
>            Assignee: Tobias Bocanegra
>
> A ReferentialIntegrityException occurs when I delete the first version succeeding the root version. Deleting other versions works fine. Here is the stack:
> javax.jcr.ReferentialIntegrityException: Unable to remove version. At least once referenced.
>         at org.apache.jackrabbit.core.version.InternalVersionHistoryImpl.removeVersion(InternalVersionHistoryImpl.java:379)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerBase.internalRemoveVersion(InternalVersionManagerBase.java:684)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl$5.run(InternalVersionManagerImpl.java:495)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl$DynamicESCFactory.doSourced(InternalVersionManagerImpl.java:760)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl.removeVersion(InternalVersionManagerImpl.java:493)
>         at org.apache.jackrabbit.core.version.InternalXAVersionManager.removeVersion(InternalXAVersionManager.java:264)
>         at org.apache.jackrabbit.core.version.VersionHistoryImpl.removeVersion(VersionHistoryImpl.java:253)
> The code is simple:
> VersionHistory vh = session.getWorkspace().getVersionManager().getVersionHistory(path);
> vh.removeVersion(version); // where version is the first version succeeding the root version

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2602) Removal of first version throws javax.jcr.ReferentialIntegrityException

Posted by "Dirk Feufel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859814#action_12859814 ] 

Dirk Feufel commented on JCR-2602:
----------------------------------

When I run your test case against 2.0.0 I get the ReferentialIntegrityException when I move the removal of the actual node after the removal of the versions. In the trunk version both versions work fine. 

> Removal of first version throws javax.jcr.ReferentialIntegrityException
> -----------------------------------------------------------------------
>
>                 Key: JCR-2602
>                 URL: https://issues.apache.org/jira/browse/JCR-2602
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: versioning
>    Affects Versions: 2.0.0
>            Reporter: Dirk Feufel
>            Assignee: Tobias Bocanegra
>
> A ReferentialIntegrityException occurs when I delete the first version succeeding the root version. Deleting other versions works fine. Here is the stack:
> javax.jcr.ReferentialIntegrityException: Unable to remove version. At least once referenced.
>         at org.apache.jackrabbit.core.version.InternalVersionHistoryImpl.removeVersion(InternalVersionHistoryImpl.java:379)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerBase.internalRemoveVersion(InternalVersionManagerBase.java:684)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl$5.run(InternalVersionManagerImpl.java:495)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl$DynamicESCFactory.doSourced(InternalVersionManagerImpl.java:760)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl.removeVersion(InternalVersionManagerImpl.java:493)
>         at org.apache.jackrabbit.core.version.InternalXAVersionManager.removeVersion(InternalXAVersionManager.java:264)
>         at org.apache.jackrabbit.core.version.VersionHistoryImpl.removeVersion(VersionHistoryImpl.java:253)
> The code is simple:
> VersionHistory vh = session.getWorkspace().getVersionManager().getVersionHistory(path);
> vh.removeVersion(version); // where version is the first version succeeding the root version

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-2602) Removal of first version throws javax.jcr.ReferentialIntegrityException

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tobias Bocanegra resolved JCR-2602.
-----------------------------------

    Fix Version/s: 2.2.0
       Resolution: Fixed

works in trunk, thus closing as fixed.

> Removal of first version throws javax.jcr.ReferentialIntegrityException
> -----------------------------------------------------------------------
>
>                 Key: JCR-2602
>                 URL: https://issues.apache.org/jira/browse/JCR-2602
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: versioning
>    Affects Versions: 2.0.0
>            Reporter: Dirk Feufel
>            Assignee: Tobias Bocanegra
>             Fix For: 2.2.0
>
>
> A ReferentialIntegrityException occurs when I delete the first version succeeding the root version. Deleting other versions works fine. Here is the stack:
> javax.jcr.ReferentialIntegrityException: Unable to remove version. At least once referenced.
>         at org.apache.jackrabbit.core.version.InternalVersionHistoryImpl.removeVersion(InternalVersionHistoryImpl.java:379)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerBase.internalRemoveVersion(InternalVersionManagerBase.java:684)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl$5.run(InternalVersionManagerImpl.java:495)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl$DynamicESCFactory.doSourced(InternalVersionManagerImpl.java:760)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl.removeVersion(InternalVersionManagerImpl.java:493)
>         at org.apache.jackrabbit.core.version.InternalXAVersionManager.removeVersion(InternalXAVersionManager.java:264)
>         at org.apache.jackrabbit.core.version.VersionHistoryImpl.removeVersion(VersionHistoryImpl.java:253)
> The code is simple:
> VersionHistory vh = session.getWorkspace().getVersionManager().getVersionHistory(path);
> vh.removeVersion(version); // where version is the first version succeeding the root version

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2602) Removal of first version throws javax.jcr.ReferentialIntegrityException

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859513#action_12859513 ] 

Tobias Bocanegra commented on JCR-2602:
---------------------------------------

Are you sure that version is not referenced by a versionable node ?

> Removal of first version throws javax.jcr.ReferentialIntegrityException
> -----------------------------------------------------------------------
>
>                 Key: JCR-2602
>                 URL: https://issues.apache.org/jira/browse/JCR-2602
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: versioning
>    Affects Versions: 2.0.0
>            Reporter: Dirk Feufel
>
> A ReferentialIntegrityException occurs when I delete the first version succeeding the root version. Deleting other versions works fine. Here is the stack:
> javax.jcr.ReferentialIntegrityException: Unable to remove version. At least once referenced.
>         at org.apache.jackrabbit.core.version.InternalVersionHistoryImpl.removeVersion(InternalVersionHistoryImpl.java:379)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerBase.internalRemoveVersion(InternalVersionManagerBase.java:684)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl$5.run(InternalVersionManagerImpl.java:495)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl$DynamicESCFactory.doSourced(InternalVersionManagerImpl.java:760)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl.removeVersion(InternalVersionManagerImpl.java:493)
>         at org.apache.jackrabbit.core.version.InternalXAVersionManager.removeVersion(InternalXAVersionManager.java:264)
>         at org.apache.jackrabbit.core.version.VersionHistoryImpl.removeVersion(VersionHistoryImpl.java:253)
> The code is simple:
> VersionHistory vh = session.getWorkspace().getVersionManager().getVersionHistory(path);
> vh.removeVersion(version); // where version is the first version succeeding the root version

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (JCR-2602) Removal of first version throws javax.jcr.ReferentialIntegrityException

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tobias Bocanegra reassigned JCR-2602:
-------------------------------------

    Assignee: Tobias Bocanegra

> Removal of first version throws javax.jcr.ReferentialIntegrityException
> -----------------------------------------------------------------------
>
>                 Key: JCR-2602
>                 URL: https://issues.apache.org/jira/browse/JCR-2602
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: versioning
>    Affects Versions: 2.0.0
>            Reporter: Dirk Feufel
>            Assignee: Tobias Bocanegra
>
> A ReferentialIntegrityException occurs when I delete the first version succeeding the root version. Deleting other versions works fine. Here is the stack:
> javax.jcr.ReferentialIntegrityException: Unable to remove version. At least once referenced.
>         at org.apache.jackrabbit.core.version.InternalVersionHistoryImpl.removeVersion(InternalVersionHistoryImpl.java:379)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerBase.internalRemoveVersion(InternalVersionManagerBase.java:684)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl$5.run(InternalVersionManagerImpl.java:495)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl$DynamicESCFactory.doSourced(InternalVersionManagerImpl.java:760)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl.removeVersion(InternalVersionManagerImpl.java:493)
>         at org.apache.jackrabbit.core.version.InternalXAVersionManager.removeVersion(InternalXAVersionManager.java:264)
>         at org.apache.jackrabbit.core.version.VersionHistoryImpl.removeVersion(VersionHistoryImpl.java:253)
> The code is simple:
> VersionHistory vh = session.getWorkspace().getVersionManager().getVersionHistory(path);
> vh.removeVersion(version); // where version is the first version succeeding the root version

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2602) Removal of first version throws javax.jcr.ReferentialIntegrityException

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859757#action_12859757 ] 

Tobias Bocanegra commented on JCR-2602:
---------------------------------------

can you create a test case that covers your issue? see examples in

 jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/RemoveVersionTest.java

> Removal of first version throws javax.jcr.ReferentialIntegrityException
> -----------------------------------------------------------------------
>
>                 Key: JCR-2602
>                 URL: https://issues.apache.org/jira/browse/JCR-2602
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: versioning
>    Affects Versions: 2.0.0
>            Reporter: Dirk Feufel
>            Assignee: Tobias Bocanegra
>
> A ReferentialIntegrityException occurs when I delete the first version succeeding the root version. Deleting other versions works fine. Here is the stack:
> javax.jcr.ReferentialIntegrityException: Unable to remove version. At least once referenced.
>         at org.apache.jackrabbit.core.version.InternalVersionHistoryImpl.removeVersion(InternalVersionHistoryImpl.java:379)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerBase.internalRemoveVersion(InternalVersionManagerBase.java:684)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl$5.run(InternalVersionManagerImpl.java:495)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl$DynamicESCFactory.doSourced(InternalVersionManagerImpl.java:760)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl.removeVersion(InternalVersionManagerImpl.java:493)
>         at org.apache.jackrabbit.core.version.InternalXAVersionManager.removeVersion(InternalXAVersionManager.java:264)
>         at org.apache.jackrabbit.core.version.VersionHistoryImpl.removeVersion(VersionHistoryImpl.java:253)
> The code is simple:
> VersionHistory vh = session.getWorkspace().getVersionManager().getVersionHistory(path);
> vh.removeVersion(version); // where version is the first version succeeding the root version

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.