Hi Suresh,
Can you please confirm your exact Alfresco version (you can extract snippet from startup log) ?
Ideally, you/we can narrow down the exact repeatable steps, to ensure that recent fixes to the VersionService also resolve your specific issue (or not).
IIRC, you're running Alfresco Enterprise, so please feel free to contact Alfresco Support (if you haven't done so already) to track your issue in more detail :-)
Thanks,
Jan
Thanks, Jan,
We are running Alfresco 5.0.3.
I will file a ticket with Alfresco support.
Regards
Suresh
Hi Suresh,
I am also facing same issue if try to upload.
Like I had doc1.pdf with 1.0 version if I try to upload minor/major version on that file I am getting error as Caused by: org.springframework.dao.ConcurrencyFailureException: Unexpected: current version does not appear to be 1st version in the list [workspace://version2Store/d788b9aa-d6aa-44a4-b43e-6562b75d5e91, workspace://SpacesStore/d319dddd-1917-4aaf-b815-750f3ca30904]
Almost same issue - then I save node and try to create version using JS I get the same error:
Caused by: org.springframework.dao.ConcurrencyFailureException: Unexpected: current version does not appear to be 1st version in the list [workspace://version2Store/d2c78435-ef7d-45fe-8533-e353e0be04ca, workspace://SpacesStore/c109c8a7-0408-497a-ae90-4400436117ac]
UPD:
In my case exception was caused by broken node versioning. Version creationg always should be done at the end of transaction, and if you try to change node after version creating it will breake this node, and in future if you will try to create new version of the node or call getCurrentVersion() using VersionService it will return this error. To repair the node you can delete versionHistory of the node, maybe there are some other methods, but I don't know them.
Example of the wrong code in JS:
...
node.createVersion("test", false);
node.properties[...] = ...;
node.save();
...
Hi,
Did anyone get any response from alfresco on this? I am also facing the same issue.
Regards,
Mahesh
Hi !
I get the same issue and fixed it.
When I try to add another version to a node, I copy properties from newNode to destinationNode then I copy nodeContent.
On node content update Alfresco try to update node's version automatically (by default).
But when I copy all properties of newNode and paste it to destinationNode, I also copy version properties of the node. It get conflicted then when Alfresco update node version.
Example :
newNode is v1.0 - destinationNode is v1.1
When I copy properties of newNode to destinationNode, I update version to 1.0. Then Alfresco tries to update version and raised a conflict because destinationNode version is 1.1
Solution :
Keep destinationNode properties of version when updating with newNode properties.
public void updateNode(NodeRef newNode, NodeRef destNode){ Map<QName, Serializable> props = mergeNodesProperties(newNode, destNode); serviceRegistry.getNodeService().setProperties(destNode, props); ContentWriter contentWriter = serviceRegistry.getContentService().getWriter(destNode, ContentModel.PROP_CONTENT, true); contentWriter.putContent(serviceRegistry.getContentService().getReader(newNode, ContentModel.PROP_CONTENT)); serviceRegistry.getNodeService().deleteNode(newNode); } private Map<QName, Serializable> mergeNodesProperties(NodeRef newNodeRef, NodeRef destNodeRef) { Map<QName, Serializable> properties = serviceRegistry.getNodeService().getProperties(newNodeRef); Map<QName, Serializable> oldProperties = serviceRegistry.getNodeService().getProperties(destNodeRef); Map<QName, Serializable> newProperties = properties.entrySet() .stream() .filter(qNameSerializableEntry -> !qNameSerializableEntry.getKey().getLocalName().toLowerCase().contains("version")) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); newProperties.putAll(oldProperties.entrySet() .stream() .filter(qNameSerializableEntry -> qNameSerializableEntry.getKey().getLocalName().toLowerCase().contains("version")) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue))); return newProperties; }
Regards,
Charles
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.