private void runPersistingLogic ( EKBCommit commit , boolean check , UUID expectedContextHeadRevision , boolean headRevisionCheck ) throws SanityCheckException , EKBException { String contextId = ContextHolder . get ( ) . getCurrentContextId ( ) ; try { lockContext ( contextId ) ; if ( headRevisionCheck ) { checkForContextHeadRevision ( contextId , expectedContextHeadRevision ) ; } runEKBPreCommitHooks ( commit ) ; if ( check ) { performSanityChecks ( commit ) ; } EKBException exception = null ; ConvertedCommit converted = edbConverter . convertEKBCommit ( commit ) ; try { performPersisting ( converted , commit ) ; runEKBPostCommitHooks ( commit ) ; } catch ( EKBException e ) { exception = e ; } runEKBErrorHooks ( commit , exception ) ; } finally { releaseContext ( contextId ) ; } }
Runs the logic of the PersistInterface . Does the sanity checks if check is set to true . Additionally tests if the head revision of the context under which the commit is performed has the given revision number if the headRevisionCheck flag is set to true .