use of org.sirix.api.PreCommitHook in project sirix by sirixdb.
the class XdmNodeWriterTrxImpl method commit.
@Override
public XdmNodeWriteTrx commit() {
mNodeReader.assertNotClosed();
// Execute pre-commit hooks.
for (final PreCommitHook hook : mPreCommitHooks) {
hook.preCommit(this);
}
// Reset modification counter.
mModificationCount = 0L;
// Optionally lock while commiting and assigning new instances.
acquireLock();
try {
final UberPage uberPage = getPageTransaction().commit();
// Remember succesfully committed uber page in resource manager.
mNodeReader.mResourceManager.setLastCommittedUberPage(uberPage);
// Reinstantiate everything.
reInstantiate(getId(), getRevisionNumber());
} finally {
unLock();
}
// Execute post-commit hooks.
for (final PostCommitHook hook : mPostCommitHooks) {
hook.postCommit(this);
}
return this;
}
Aggregations