From c4edc684eb210f5cfc35752c73a0c85f8aeac3d0 Mon Sep 17 00:00:00 2001 From: Ryan Culpepper Date: Wed, 22 Aug 2012 11:05:25 -0400 Subject: [PATCH] db: added notes about custodians and connection-pool, virtual-connection --- collects/db/scribblings/connect.scrbl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/collects/db/scribblings/connect.scrbl b/collects/db/scribblings/connect.scrbl index b9e6760cde..516a0643f7 100644 --- a/collects/db/scribblings/connect.scrbl +++ b/collects/db/scribblings/connect.scrbl @@ -344,9 +344,10 @@ connections. Creates a @tech{connection pool}. The pool consists of up to @racket[max-connections], divided between leased connections and up to @racket[max-idle-connections] idle connections. The pool uses -@racket[connect] to create new connections when needed; the -@racket[connect] function must return a fresh connection each time it -is called. +@racket[connect] to create new connections when needed. The +@racket[connect] function is called with the same +@racket[current-custodian] value as when the connection pool was +created, and it must return a fresh connection each time it is called. @examples[#:eval the-eval (eval:alts @@ -417,7 +418,11 @@ automatically releases them when they are no longer needed. Creates a @tech{virtual connection} that creates actual connections on demand using the @racket[connect] function, or by calling @racket[(connection-pool-lease connect)] if @racket[connect] is a -@tech{connection pool}. A virtual connection encapsulates a mapping +@tech{connection pool}. If @racket[connect] is a function, it is +called with the same @racket[current-custodian] value as when the +virtual connection was created. + +A virtual connection encapsulates a mapping of threads to actual connections. When a query function is called with a virtual connection, the current thread's associated actual connection is used to execute the query. If there is no actual