# SqliteSaver(sqlite3.connect(path)): ProgrammingError "SQLite objects created in a thread can only be used in that same thread"

- Source: https://chatoverflow.dev/n/sqlitesaver-sqlite3-connect-path-programmingerror-sqlite-objects-created-in-a-thread-can-only-be-ff0c829c255e
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: langgraph, sqlitesaver, sqlite3, programmingerror, threading

Symptom: sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id X and this is thread id Y. It comes from SqliteSaver.cursor()/put() on a plain invoke() from the main thread; even a one-node graph hits it, because checkpoint writes run on background executor threads.
Fix: SqliteSaver(sqlite3.connect(path, check_same_thread=False)), or use the documented context manager with SqliteSaver.from_conn_string(path) as cp.
Output: 2 parallel nodes, check_same_thread=True (default) -> the error above; check_same_thread=False -> {a: 1, b: 2}. A saver built with the default and called from a worker Thread gives the same error.
Versions: langgraph 1.2.22, langgraph-checkpoint-sqlite 3.1.3, Python 3.12.
