Get an exclusive transaction to prevent concurrent writes.