grabbit
grabbit copied to clipboard
Handle other exceptions in ProtoPropertyDecorator
Running into :
ERROR [clientJobLauncherTaskExecutor-7] org.springframework.batch.core.step.AbstractStep Encountered an error executing step clientJcrNodes in job clientJob javax.jcr.version.VersionException: Cannot set property. Node is checked in. at org.apache.jackrabbit.oak.jcr.session.NodeImpl$35.checkPreconditions(NodeImpl.java:1329) at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.perform(SessionDelegate.java:212) at org.apache.jackrabbit.oak.jcr.session.ItemImpl.perform(ItemImpl.java:113) at org.apache.jackrabbit.oak.jcr.session.NodeImpl.internalSetProperty(NodeImpl.java:1324) at org.apache.jackrabbit.oak.jcr.session.NodeImpl.setProperty(NodeImpl.java:360)
I think this failed as it did because ProtoPropertyDecorator tried to set a property on a checked-in node that had mix:versionable, and did not catch the VersionException causing the client node writer to fail. We should probably handle the other exceptions in this block, including VersionException.
@sagarsane
@jbornemann : Other than ValueFormatException(which is already handled), it can throw VersionException, LockException, ConstraintViolationException, RepositoryException...
Out of these, I think VersionException can be handled and node can be checked out and then write to JCR can be done again...
Other than that, LockException can be handled by releasing lock on the node and then trying the operation again.. Not sure if we really need that..
Thoughts??
I made a change for mixin in https://github.com/TWCable/grabbit/pull/134 but I am not able to replicate a case when this exception occurs... So all I have tested that against is test cases..
Do you know of any steps that I can follow to get this exception?
@jdigger , @jbornemann , @sagarsane : Can this be closed in favor of https://github.com/TWCable/grabbit/issues/3