Coder Social home page Coder Social logo

A connection pool for type 1 drivers about dbkit HOT 5 OPEN

kgaughan avatar kgaughan commented on September 25, 2024
A connection pool for type 1 drivers

from dbkit.

Comments (5)

kgaughan avatar kgaughan commented on September 25, 2024

Some kind of threadlocal storage would be ideal, but we need to trap when the thread exits.

from dbkit.

kgaughan avatar kgaughan commented on September 25, 2024

Getting there. Punting the issue with threads exiting to weak references. ThreadAffinePool needs testing though.

from dbkit.

kgaughan avatar kgaughan commented on September 25, 2024

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.

kgaughan avatar kgaughan commented on September 25, 2024

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.

kgaughan avatar kgaughan commented on September 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.