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:                         for i,j in fieldMap do
                              args.[j] <- reader.Reader.GetValue(i) 
                          yield cons.Invoke(args) :?> 'T
              } 
  
            member x.ExecuteScalar(sql:string) =
              if x.LogQueries then x.Log(sql)
              use comm = x.Command sql
              comm.ExecuteScalar()
  
  
            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.Pool.Take()
              use command =  connection.CreateCommand() 
              command.CommandText <- name 
              command.CommandType <- CommandType.StoredProcedure
              new DynamicSqlCommand(command,(fun () -> conn.Pool.Release(connection)),conn.Opts,conn.Log)
  
            member x.cc comm = x.Command comm
            member x.Command(commandText:string) =
              let conn = pool.Take()
              use comm = conn.CreateCommand()
              comm.CommandText <- commandText
              //match trans with | None -> () | Some(t) -> comm.Transaction <- t
              new DynamicSqlCommand(comm,(fun () -> pool.Release(conn)),x.Opts,x.Log)
  
            member x.StartTrans() = 
              let conn = pool.Take() // reserve a connection that will be shared across the transaction
              new DynamicSqlTransaction(conn,(fun () -> pool.Release(conn)),x.Opts,x.Log)
  
            interface IDisposable with
              member x.Dispose() = 
  
negative.code:             //use command =  connection.CreateCommand()
              //use command = new DynamicSqlCommand(sql,fun () -> pool.Release(connection))
              //command.CommandText <- sql 
              //if x.LogQueries then x.Log(sql)
  
              use command : DynamicSqlCommand = x.Command sql
              /// Determine details of this record's constructor
              let cons = typeof<'T>.UnderlyingSystemType.GetConstructors() |> Array.filter (fun c -> c.IsConstructor) |> Seq.head
              let argMap = cons.GetParameters() |> Array.mapi (fun i v -> (v.Name.ToLower(),i)) |> Map.ofSeq
              let args = Array.init (cons.GetParameters().Length) (fun _ -> Object())
  
              seq {
              
                  let start = System.DateTime.Now
  
                  use reader = command.ExecuteReader()
                  let fieldMap = [for i in 0..reader.Reader.FieldCount-1 -> 
                                      match argMap.TryFind (reader.Reader.GetName(i).ToLower()) with
  