Git Product home page Git Product logo

Comments (3)

franciscojunior avatar franciscojunior commented on June 8, 2024

I think you have a good point here.

I think this issue didn't appear before because we are always asking users to use the pattern of open the connection, use it and then close it. This way, it isn't normal to accumulate too much prepared statements.

Another point is that we discouraged the use of prepared statements because they had poor performance. Now that Glen added a lot of optimizations, I think more and more prepared statements will be used and this issue may start to be noticed.

Thank you very much, Udo, for bringing our attention to this. We will work on it for the 2.2 release. I'll add a milestone to indicate that.

from npgsql.

roji avatar roji commented on June 8, 2024

Guys, this is a pretty important item, I'll take a look at it, hopefully it will make it into 2.2.

from npgsql.

roji avatar roji commented on June 8, 2024

Implementation note to self: we can't do any sort of database interaction from with Dispose() (i.e. DEALLOCATE) since when executed from the finalizer (can be whenver) this causes contention on the database connection with whatever query is actually being executed.

Can't lock either, since any sort of blocking within a finalizer is a big no-no.

So need to push the DEALLOCATE to a queue to be processed at the earliest convenience. It would be nice to be able to check, from Dispose(), whether the connection is in use (TryLock) and have a fast-path, but there's no such lock currently in Npgsql. This mechanism would also be relevant for #270.

from npgsql.

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.