Переглянути джерело

Improved odbc settings and number of connections (#6699)

* Improved odbc connection settings

* Increased maximum number of database connections

Co-authored-by: LLT21 <[email protected]>
LLT21 4 роки тому
батько
коміт
7b04fb3c42

+ 3 - 1
frameworks/CSharp/appmpower/odbcinst.ini

@@ -14,4 +14,6 @@ Description=ODBC for PostgreSQL
 ; WARNING: The old psql odbc driver psqlodbc.so is now renamed psqlodbcw.so
 ; in version 08.x. Note that the library can also be installed under an other
 ; path than /usr/local/lib/ following your installation.
-Driver=/usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so
+Driver = /usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so
+Threading = 1
+CPTimeout = 0

+ 2 - 2
frameworks/CSharp/appmpower/src/Db/PooledConnections.cs

@@ -9,7 +9,7 @@ namespace appMpower.Db
    {
       private static bool _connectionsCreated = false;
       private static byte _createdConnections = 0;
-      private static byte _maxConnections = Math.Min((byte)Environment.ProcessorCount, (byte)21);
+      private static byte _maxConnections = 255; //Math.Min((byte)Environment.ProcessorCount, (byte)21);
       private static ConcurrentStack<PooledConnection> _stack = new ConcurrentStack<PooledConnection>();
       private static ConcurrentQueue<TaskCompletionSource<PooledConnection>> _waitingQueue = new ConcurrentQueue<TaskCompletionSource<PooledConnection>>();
 
@@ -70,4 +70,4 @@ namespace appMpower.Db
          }
       }
    }
-}
+}