AbstractUnitOfWork module (ska_db_oda.unit_of_work.abstractunitofwork)

This module contains the UnitOfWork Abstract Base Class.

All UnitOfWork implementations to conform to this interface.

class ska_db_oda.unit_of_work.abstractunitofwork.AbstractUnitOfWork[source]

Provides the interface to store or retrieve a group of OSO Entities.

Commits or rollsback a series of database transactions as an atomic operation

abstract commit() None[source]

Commits the entities added to this Unit of Work to the database, as an atomic transaction.

Raises:

ValueError – if the validation of committed sbds or the metadata fails

abstract rollback() None[source]

Initiates the rollback of this Unit of Work, so that none of the entities are persisted.

If no commit is carried out or an error is raised, the unit of work is rolled back to a safe state