@Override
	public LocalManagedBufferFile openForUpdate(long checkoutId) throws IOException {
		if (fileSystem.isReadOnly()) {
			throw new ReadOnlyException();
		}
		synchronized (fileSystem) {
			if (isVersioned) {
				beginCheckin(checkoutId);
				boolean success = false;
				try {
					LocalManagedBufferFile bfile = versionedDb.openBufferFileForUpdate(checkoutId);
					success = true;
					return bfile;
				}
				finally {
					if (!success) {
						endCheckin(checkoutId);
					}
				}
			}
			return privateDb.openBufferFileForUpdate();
		}
	}
Open the latest database version for update.
@param checkoutId reqiured for update to a versioned item, otherwise set to -1 for
a non-versioned private database.
@return open database handle
@throws IOException
Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/store/local/LocalDatabaseItem.java