feat(dbapi): add retry_aborts_internally option to Connection by waiho-gumloop · Pull Request #1538 · googleapis/python-spanner
Add a `retry_aborts_internally` flag (default True) to the DBAPI Connection class and the `connect()` function. When set to False, aborted transactions raise `RetryAborted` directly from `commit()` instead of entering the internal statement-replay retry loop. This allows applications that implement their own transaction retry logic (e.g. re-invoking a callable with a fresh session) to avoid nested retry loops and contention amplification under concurrent writes. Equivalent to `RETRY_ABORTS_INTERNALLY` in the Spanner JDBC driver and `ReadWriteStmtBasedTransaction` in the Go client.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters