From 9fcaa9cef2edfe4114b8add547ab6f6fde2025f9 Mon Sep 17 00:00:00 2001 From: Cody Fincher <204685+cofin@users.noreply.github.com> Date: Mon, 9 Feb 2026 09:55:04 -0600 Subject: [PATCH] =?UTF-8?q?Revert=20"fix(aiosqlite):=20commit=20pending=20?= =?UTF-8?q?transactions=20on=20pool=20release=20instead=20o=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5a5f8b2c79f7db7d54bfeeea69194b02f2f62d11. --- sqlspec/adapters/aiosqlite/pool.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sqlspec/adapters/aiosqlite/pool.py b/sqlspec/adapters/aiosqlite/pool.py index f663b2fa..fae8ccf1 100644 --- a/sqlspec/adapters/aiosqlite/pool.py +++ b/sqlspec/adapters/aiosqlite/pool.py @@ -679,11 +679,10 @@ async def release(self, connection: AiosqlitePoolConnection) -> None: return try: - # Auto-commit pending transactions on release (matches sqlite adapter behavior). - # Without this, DML executed outside explicit begin/commit is silently rolled back. + # Fast path: skip timeout wrapper for reset, just do the rollback directly + # The rollback itself is fast for SQLite; timeout is overkill for hot path with suppress(Exception): - if connection.connection.in_transaction: - await connection.connection.commit() + await connection.connection.rollback() connection.idle_since = time.time() # mark_as_idle inline self._queue.put_nowait(connection) except Exception as e: