[racket] db connection-pool tip

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Tue Aug 21 18:33:32 EDT 2012

When using the "db" collection's "connection-pool" procedure, important 
safety tip: it uses the "current-custodian" from the context in which 
"connection-pool" is applied.

(This sounds obvious when stated, but you might not realize it if you 
retrofitted "connection-pool" into a legacy app, in which the app would 
transparently create new "connection-pool"s on demand (within 
short-lived threads, ahem), and your first recycled connection would 
have "connected?" true before failing with exception "query: not 
connected", and there were a dozen things you debugged first before your 
attention is directed back at "connection-pool"...)

Neil V.

Posted on the users mailing list.