GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-131918: Add _ThreadLocalSqliteConnection in dbm.sqlite by meghprkh · Pull Request #131920 · python/cpython Conversation
| ||||||||||||||||||||||||||||||||||
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
IMO, yes. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -0,0 +1 @@ | |||
| Fixes dbm.sqlite3 for multi-threaded use-cases by using thread-local connections. | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| Fixes dbm.sqlite3 for multi-threaded use-cases by using thread-local connections. | |
| Make :mod:`dbm.sqlite3` thread-safe by using thread-local database connections. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hmm this fix doesnt really work with As in currently the close method closes connections from other threads, which would give the same error. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Not too familiar with There should probably be a docs update to explain exactly what thread-safety guarantees this is making (and if they depend on |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Very weirdly, on my system (Fedora Linux), the sqlite3.threadsafety is set to 3 by default, but I still seem to be getting the error |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| wrthread = ref(thread, thread_deleted) | ||
| try: | ||
| conn = sqlite3.connect(self._uri, autocommit=True, uri=True) | ||
| self._conn[id(thread)] = conn |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| self._conn[id(thread)] = conn | |
| self._conn[thread.native_id] = conn |
Hmm why not using native_id?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Closing, its a stale draft PR and changes haven't been made. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.