anchor.diff:                                                  c
          
                                             )
  +
             let opts : ConnOpts =  {logfile = None ; logfileName = None ; logQueries = false;  logLongerThan = 999999.0 ; 
                                       logConnUse = false }
  +        
  +          let log (msg:string) =
  +            match opts.logfile with
  +                | None -> ()
  +                | Some(f) -> lock opts.logfile ( fun _ -> f.Write(System.DateTime.Now.ToString("yyyyddMM HH:mm:ss.FFF")); f.Write("\t") ; f.WriteLine(msg) ; f.Flush())
  +          
  +          let take() = 
  +            let c = pool.Take()
  +            let z = System.Threading.Thread.CurrentThread.ManagedThreadId
  +            if opts.logConnUse then log(sprintf "take %d %d" z (c.GetHashCode()))
  +            c
  +            
  +          let release x = 
  +            let z = System.Threading.Thread.CurrentThread.ManagedThreadId
  +            if opts.logConnUse then log(sprintf "release %d %d" z (x.GetHashCode()))
  +            sprintf  "release %d" (x.GetHashCode()) |> log; pool.Release x
             
             /// Set a filename for logging output
             member x.Logfile with  get() = opts.logfileName.Value and 
  
positive.code:                                     opts.logfileName <- Some(fileName)
                                      opts.logfile<- Some(new StreamWriter(fileName))
  
            member x.Opts with get() = opts
            member x.Log(msg:string) =
              match opts.logfile with
                  | None -> ()
                  | Some(f) -> lock opts.logfile ( fun _ -> f.Write(System.DateTime.Now.ToString("yyyyddMM HH:mm:ss.FFF")); f.Write("\t") ; f.WriteLine(msg) ; f.Flush())
            
            member x.LogConnUse with get() = opts.logConnUse and set(v) = opts.logConnUse <- v  
            member x.LogQueries with get() = opts.logQueries and set(v) = opts.logQueries <- v  
            member x.LogLongerThan with get() = opts.logLongerThan  and set(v) = opts.logLongerThan <- v  
  
negative.code:                         for i,j in fieldMap do
                              args.[j] <- reader.Reader.GetValue(i) 
                          yield cons.Invoke(args) :?> 'T
  
                  if opts.logQueries || ((System.DateTime.Now - start).TotalMilliseconds > opts.logLongerThan) then
                      sprintf "%d\t%f\t%s" (command.GetConnHash()) ((System.DateTime.Now-start).TotalMilliseconds) sql |> x.Log
                      
              } 
  
            member x.ExecuteScalar(sql:string) =
              if x.LogQueries then x.Log(sql)
              let start = System.DateTime.Now
              use comm = x.Command sql
              let r = comm.ExecuteScalar()
  
              if opts.logQueries || ((System.DateTime.Now - start).TotalMilliseconds > opts.logLongerThan) then
                      sprintf "%d\t%f\t%s" (x.GetHashCode()) ((System.DateTime.Now-start).TotalMilliseconds) sql |> x.Log
              r
  
  
            new(connStr:string) = new DynamicSqlConnection(connStr,10)
            member private x.Pool = pool
            /// Creates command that calls the specified stored procedure
            static member (?) (conn:DynamicSqlConnection, name) = 
              let connection = conn.Take() // Pool.Take()
              use command =  connection.CreateCommand() 
              command.CommandText <- name 
              command.CommandType <- CommandType.StoredProcedure
              new DynamicSqlCommand(command,(fun () -> conn.Release(connection)),conn.Opts,conn.Log)
  
            member x.cc comm = x.Command comm
            member x.Command(commandText:string) =
              let conn = x.Take()
              use comm = conn.CreateCommand()
              comm.CommandText <- commandText
              //match trans with | None -> () | Some(t) -> comm.Transaction <- t
              new DynamicSqlCommand(comm,(fun () -> x.Release(conn)),x.Opts,x.Log)
  
            member x.StartTrans() = 
              let conn = x.Take() // reserve a connection that will be shared across the transaction
              new DynamicSqlTransaction(conn,(fun () -> x.Release(conn)),x.Opts,x.Log)
  
            interface IDisposable with
              member x.Dispose() = 
  