Browse Source

[F#/Oxpecker] Returned back command auto-prepare (#9454)

Vladimir Shchur 10 months ago
parent
commit
4056dc9e72

+ 2 - 2
frameworks/FSharp/oxpecker/src/App/Common.fs

@@ -26,9 +26,9 @@ module Common =
     }
     }
 
 
     [<Literal>]
     [<Literal>]
-    let ConnectionString = "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=1024;NoResetOnClose=true;Enlist=false"
+    let ConnectionString = "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=1024;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4"
     [<Literal>]
     [<Literal>]
-    let MultiplexedConnectionString = ConnectionString + ";Max Auto Prepare=3;Multiplexing=true"
+    let MultiplexedConnectionString = ConnectionString + ";Multiplexing=true"
 
 
     let FortuneComparer = {
     let FortuneComparer = {
         new IComparer<Fortune> with
         new IComparer<Fortune> with

+ 0 - 2
frameworks/FSharp/oxpecker/src/App/Db.fs

@@ -14,7 +14,6 @@ module Db =
             use db = new NpgsqlConnection(ConnectionString)
             use db = new NpgsqlConnection(ConnectionString)
             use cmd = db.CreateCommand(CommandText = "SELECT id, message FROM fortune")
             use cmd = db.CreateCommand(CommandText = "SELECT id, message FROM fortune")
             do! db.OpenAsync()
             do! db.OpenAsync()
-            do! cmd.PrepareAsync()
             use! rdr = cmd.ExecuteReaderAsync(CommandBehavior.CloseConnection)
             use! rdr = cmd.ExecuteReaderAsync(CommandBehavior.CloseConnection)
             while! rdr.ReadAsync() do
             while! rdr.ReadAsync() do
                 result.Add { id = rdr.GetInt32(0); message = rdr.GetString(1) }
                 result.Add { id = rdr.GetInt32(0); message = rdr.GetString(1) }
@@ -46,7 +45,6 @@ module Db =
             let struct(cmd', _) = createReadCommand db
             let struct(cmd', _) = createReadCommand db
             use cmd = cmd'
             use cmd = cmd'
             do! db.OpenAsync()
             do! db.OpenAsync()
-            do! cmd.PrepareAsync()
             return! readSingleRow cmd
             return! readSingleRow cmd
         }
         }