/// <summary>
/// Finish, write, commit this change, and release the index lock.
/// <para />
/// If this method fails (returns false) the lock is still released.
/// <para />
/// This is a utility method for applications as the finish-write-commit
/// pattern is very common after using a builder to update entries.
/// </summary>
/// <returns>
/// True if the commit was successful and the file contains the new
/// data; false if the commit failed and the file remains with the
/// old data.
/// </returns>
/// <exception cref="IOException">
/// The output file could not be created. The caller no longer
/// holds the lock.
/// </exception>
public virtual bool commit()
{
finish();
_cache.write();
return(_cache.commit());
}