Wrap each repository in its own transaction during a metadata import
Context
In !136 (merged) we have introduced a tool to import metadata from a registry filesystem into a database.
Problem
Currently, we're wrapping the whole import in a single transaction. This is not ideal because we can't retry imports and the database transaction log will grow considerably for really large repositories, placing additional pressure on the system due to high I/O.
Solution
Wrap the import of each repository in its own database transaction, allowing for retries and efficient use of transaction logs. If the dry-run flag is provided, we should continue to wrap everything in a transaction to allow for a single rollback.
Edited by João Pereira