Question on ipooledobjectpolicy RRS feed

  • Question

  • User-1204637165 posted

    Please I am using ipooledobjectpolicy to manage connections in my web application.

    So I create a pool of 10 object with virtual connection to another system.

    I do recycle this objects that I created using ipooledobjectpolicy.

    Please I would love to konw what wouold happen supposing all this object get disposed. Cos the object that I am recycling are disposable object.

    is my ipooledobjectpolicy resource goign to help me create a new set of object supposing the objects that I am recycling no longer exits.

    Like if they get disposed for what ever reason so far.

    Saturday, September 19, 2020 12:34 PM

All replies

  • User-474980206 posted

    Only your internal pool code should call dispose. You would do this if you pool implemented an idle timeout. if code fetched an object from the pool, disposed and returned it. The next caller could  get a disposed object. This would lead all kinds of issues.

    Sunday, September 20, 2020 9:47 PM