I'm implementing pooled database connection for seaside sessions.
Here's my first cut at it:
(PoolSession is a subclass of WASession, but that's not important
for the moment).
PoolSession>>initialize
pool := SharedQueue new.
PoolSession>>addToPool: anObject
pool nextPut: anObject
PoolSession>>withPooledDo: aBlock
| poolEntry |
[poolEntry := pool next.
aBlock value: poolEntry]
ensure: [pool nextPut: poolEntry]
Is that enough to ensure after use the connection gets put back
in the pool or do I need some additional exception catching or
process arbitration or whatever?
I probably want to validate the pooled connection before giving it
out so dead database connections get discarded/replaced, but that's
for later.
mjl
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside