In my project, I have multiple event listeners, workflows, and Sling
jobs that can modify the very same asset at the same time which
sometimes causes commit conflicts. Obviously, different JCR sessions try
to save different changes. I thought that refreshing the session before
the actual .commit() call would help, but it didn't. I need some
explanation why the following code throws this
exceptionorg.apache.sling.api.resource.PersistenceException: Unable to
commit changes to session...Caused by:
...