{
  "id": "python/sqlalchemy-exc-invalid-request-session-expired",
  "signature": "sqlalchemy.exc.InvalidRequestError: This session is in 'expired' state. No further SQL can be emitted within this transaction.",
  "signature_zh": "此会话处于“过期”状态。无法在此事务中发出更多 SQL。",
  "regex": "sqlalchemy\\.exc\\.InvalidRequestError:\\ This\\ session\\ is\\ in\\ 'expired'\\ state\\.\\ No\\ further\\ SQL\\ can\\ be\\ emitted\\ within\\ this\\ transaction\\.",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The session has been expired due to a rollback or close, and attempting to execute SQL on it raises this error.",
  "root_cause_type": "generic",
  "root_cause_zh": "会话因回滚或关闭而过期，尝试对其执行 SQL 会引发此错误。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Using expire_all() to revive session",
      "why_fails": "",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Creating new session without closing old",
      "why_fails": "",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Close and create new session",
      "success_rate": 0.95,
      "how": "Close the expired session and create a new one: session.close(); session = Session()",
      "condition": "",
      "sources": []
    },
    {
      "action": "Start new transaction",
      "success_rate": 0.8,
      "how": "Use session.begin() to start a new transaction if the session is still in a recoverable state.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-07-22",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}