Saga continues ([Zope-DB] DCOracle2: close connection doesn't)
chrisw at simplistix.co.uk
Thu Oct 23 14:05:05 EDT 2003
Bo M. Maryniuck wrote:
> On Thursday 23 October 2003 15:47, Chris Withers wrote:
>>What do you mean by 'needed' here?
> I mean I have in production huge cache (10.000 objects or more, 20 threads
> etc). So I really dislike this idea to flush everything from the Cache...
Why do you have so many threads?
>>Well, it could catch the exception oracle throws and re-connect, surely?
That's what I want to implement ;-)
> Well, yes. So C code of dco2 SHOULD have timeout feature. Though I am not sure
> it has (should see one day). But I am a bit timecontstrained...
If you can tell me what to write, I can write it :-)
(Matt, that goes for you too :-P)
> Connection is da whole Zope approach by sharing connectors between threads
> using volatile attributes. In this case we sometimes have large amount of
> connections, while we usually need one-two-three maximum...
I'm currently looking at how the other DA's do this, the only idea that's popped
into my head so far is a module-level variable storing the connection pool.
ZOracleDA threads can then retrieve a connection from this pool is a section of
code protected by a python Lock and put it back when they're done.
If there are no connections available, then a new one would be opened, up to a
maximum equal to the number of Zope threads.
What problems/weaknesses can people see with this approach?
More information about the Zope-DB