Hi all,
a while ago we accidentally created a wrong configuration of the
workspace persistence managers on one of our systems, which was only
active for a short time, but obivously long enough to create an
inconsistency between the workspace and repository (version) database
for at least one node.
We use the Bundle Persistence Manager with MySQL for both the
workspace and the version data. The misconfiguration mentioned above
lead to the situation that the database for the workspace was updated
correctly when entering new content, but the database for the version
storage was not (the db connection of the Persistence Manager for the
version storage went to a wrong database).
The situation is now that I have a versionable node in my workspace
with a jcr:predecessors property that contains a nonexistent UUID.
This leads to a NullPointerException in
AbstractVersionManager.calculateCheckinVersionName when I try to
checkin the node. As I have found only one node in the repository so
far that has this problem, my preferred solution would be to just
bring this one node back to state that does not throw exceptions,
either manually or through a small script.
My question to you is now: Is it somehow possible to reset the value
of the node's jcr:predecessors property to the UUID of the last
version that exists in the version storage? Or to reset the complete
version history of the node? It would be acceptable to lose the old
versions of the node, but I do not want to delete and recreate the
node in the workspace, because there is a lot of other content below
it. I know that it is not possible through JCR, but maybe through
Jackrabbit API or some dirty hack... I have already tried to remove
and re-add the mix:versionable type to the node, but that did not
reset the version history.
If not, I guess the only way would be to copy the content of this
node and its subtree into a new node structure in the same position
of the tree and delete the old node. Could someone comment on what
would be the best way to do this?
Best regards and thanks,
Jan