]> git.ipfire.org Git - pbs.git/commit
database: Replace the old database model with a connection pool
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 21 Jul 2023 10:16:51 +0000 (10:16 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 21 Jul 2023 10:16:51 +0000 (10:16 +0000)
commit9334c1a48fb1542aa453403ca5e4bb37170a64de
treef474697fdb9742c23a392365cec1f0636af51470
parentd4ecf08d9c38a71e1061a91098c35c12b96da7a5
database: Replace the old database model with a connection pool

This patch introduces a connection pool to the database. When a function
is executing a query, a connection will be handed to the (asyncio) Task
and remains with that task until its end.

That way, multiple concurrent tasks (even when they are running in the
same thread) will have an exclusive connection to the database which
will avoid that we overwrite and commit transactions of other tasks.

Additionally, transactions can now be nested as psycopg's transactions
are more advanced than the previous Transaction class.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
configure.ac
src/buildservice/database.py