diff --git a/backend/app/core/database.py b/backend/app/core/database.py index cee22d64..45dc8288 100644 --- a/backend/app/core/database.py +++ b/backend/app/core/database.py @@ -27,6 +27,9 @@ async def get_db() -> AsyncSession: async with async_session_maker() as session: try: yield session + except Exception: + await session.rollback() + raise finally: await session.close()