Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

VersionManager Checkout and checkin - AEM6.1

Avatar

Level 3

Hi,

I am trying to delete the existing property (Both key-value) from a node and then calling node.setProperty() to add a new property for a given node. My node has property as:  "jcr:mixinTypes: mix:versionable"

I randomly started getting error as: OakVersion0001: Cannot delete property on checked in node.

I think when there are large no of nodes to process, the above error is frequent. I do not get this error always.

In order to fix this issue, I thought to call first checkout() and then checkin() on the node,  getting below exception:

Unable to perform checkin. Session has pending changes.

Can you please tell me what is missing here during checkout() and checkin() calls? Also, how does it work while multiple sessions are trying to update the same Node?

API documentation says:

InvalidItemStateException - if this Session (not necessarily this Node) has pending unsaved changes.

Exception thrown by the write methods of Node and Property and by save and refresh if an attempted change would conflict with a change to the persistent workspace made through another Session. Also thrown by methods of Node and Property if that object represents an item that has been removed from the workspace.

Thanks.

0 Replies