]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add support for two-phase commit in oracledb.
authorFederico Caselli <cfederico87@gmail.com>
Mon, 10 Jun 2024 19:20:56 +0000 (21:20 +0200)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 1 Aug 2024 14:43:11 +0000 (10:43 -0400)
commita9c0487c024410d446b8be3f528e051318dd150e
tree91526aad733009d09351579e12ddfe85c5a6403c
parent1442a71916381ff8f6bbedb33d9e61938eb84778
Add support for two-phase commit in oracledb.

Implemented two-phase transactions for the oracledb dialect. Historically,
this feature never worked with the cx_Oracle dialect, however recent
improvements to the oracledb successor now allow this to be possible.  The
two phase transaction API is available at the Core level via the
:meth:`_engine.Connection.begin_twophase` method.

As part of this change, added new facility for testing that allows
a test to skip if a certain step takes too long, allowing for a
separate cleanup step.  this is needed as oracle tpc wont allow
commit recovery if transaction is older than about 1 second, could not
find any docs on how to increase this timeout.

Fixed an execute call in the PostgreSQL dialect's provisioning that
drops old tpc transactions which was non-working, which indicates
that we've apparently never had any PG tpc transactions needing to
be cleaned up in CI for some years now, so that's good

Fixes: #11480
Change-Id: If3ad19cc29999e70f07f767b88afd330f6e5a4be
doc/build/changelog/unreleased_20/11480.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/oracle/base.py
lib/sqlalchemy/dialects/oracle/cx_oracle.py
lib/sqlalchemy/dialects/oracle/oracledb.py
lib/sqlalchemy/dialects/postgresql/provision.py
lib/sqlalchemy/testing/__init__.py
lib/sqlalchemy/testing/util.py
test/engine/test_transaction.py
test/requirements.py