Comments (5)
Some kind of threadlocal storage would be ideal, but we need to trap when the thread exits.
from dbkit.
Getting there. Punting the issue with threads exiting to weak references. ThreadAffinePool needs testing though.
from dbkit.
Turns out the sqlite3 driver doesn't like weak references being used with its connections. Weak. I've switched to using strong references for it. This does not make me happy. Also added DummyPool, which is specifically meant for type 0 drivers where it forces a single connection at a time, but will allow multiple connections with more capable drivers.
from dbkit.
ThreadAffinePool
has been nixed for the moment: it has race conditions.
When using DummyPool
with the sqlite3
driver module and waitress, I'm getting "ProgrammingError: Cannot operate on a closed database" as an exception. My guess is that this is some kind of race condition, and it may affect Pool
in some way that I don't know about (even though it appears to work just fine).
from dbkit.
Still can't get type 1 driver support right, so I'm removing it and maybe creating a separate branch.
from dbkit.
Related Issues (20)
- Tests for connection pooling and prepared statements
- Allow loggers and default factories to be set on connection pools
- Subclass threading.local for use in Context and ThreadAffinePool
- Handle closed connections gracefully
- Connection recycling
- Make connection pools context managers
- Fix placeholders once and for all
- Simple insertion of objects.
- Allow wrapping of individual connections in a dbkit context.
- Python3 support HOT 2
- Split out some driver-specific abstractions
- Support for ETL (Extract, Transform, Load)
- Resultset export
- Make DictFactory and AttrDict a bit more memory-frugal.
- Document default_factory better
- Add support for mogrify HOT 1
- Transaction decorator
- AbortTransaction exception
- Dealing properly with connection timeouts, &c. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbkit.