# 此会话处于“已提交”状态。无法在此事务中发出更多 SQL。

- **ID:** `python/sqlalchemy-invalid-request-session-committed`
- **领域:** python
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

在会话已提交后尝试执行 SQL 语句，这会结束当前事务。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **Start a new transaction with session.begin()** (90% 成功率)
   ```
   Use session.begin() to start a new transaction explicitly after commit, or use session.close() and create a fresh session.
   ```
2. **Use context manager for transaction** (95% 成功率)
   ```
   Refactor code to perform all SQL operations within a single transaction block using 'with session.begin():'.
   ```

## 无效尝试

- **Calling session.rollback() after commit** —  (80% 失败率)
- **Creating a new session without closing the old one** —  (50% 失败率)
