On Sep 30, 2005, at 9:57 AM, Kevin Dangoor wrote:

It's easier than that, even if the code doesn't seem that way. You
just need to remove this line:
                TheURIOpener.cachedURIs = {}

That's the hack for sqlite.
When connectionForURI is called with the same URI, it returns the same
DBConnection object. So, there are multiple underlying psycopg
connections but only one DBConnection object, and therefore, only one
cache.

(Note that switching to use a transaction gives you a new DBConnection
object, new cache and all that... which is what you want.)

Kevin



Ah cool -- I see that now. I *think* there's one problem left, when using a transaction -- the "classic" cacheValues=True one. If I change object Foo(id=1) within a Transaction ( and hence a new DB connection), then I can still have a stale object in the other shared DB connection cache.

-- David

Reply via email to