Database#

class ccat_data_transfer.database.DatabaseConnection[source]#

Bases: object

classmethod get_connection() Tuple[scoped_session, Engine][source]#

Get a database connection.

classmethod remove_session()[source]#

Dispose the thread-local session so the next access starts clean.

Service poll loops call this once per iteration: it guarantees a poisoned (aborted-transaction) session from a prior cycle never carries over, so a transient DB error cannot wedge the loop into a permanent PendingRollbackError state. With the NullPool engine, scoped_session.remove() also returns the underlying connection, so a dropped connection is re-established on next use.

classmethod reset()[source]#

Reset the connection (mainly for testing)

Overview#

Database connection and ORM models for the data transfer system.

Key Components#

  • Database connection management

  • ORM model definitions

  • Database session handling