Hi,
I have two back-end servers on a single nuxeo-5.6 repository with concurrent scheduled import jobs running.
To avoid concurrent document creation, I use a try {} catch {} block and set a document lock on a common parent document :
try {
/* … */
session.setLock(parentDocument.getRef());
/* … */
/* do multiple documents creation */
} finally {
session.removeLock(parentDocument.getRef());
}
It did worked fine… until today, two concurrent document creation occurred.
So is CoreSession#setLock(DocumentRef ref) a good way of handling mutual exclusion between servers ?
Is there a good (or more atomic) way of writing cluster-safe process ?
Cheers,
Léa Raya DÉCORNOD