1

I understand the topic is not new, I read a few posts but did not come to the answer ...

Each time the connection is opened for a very long time, but the idea was to use a connection pool, is not it?

As I understand it in MySQL you cannot specify a connection pool in the connection string.

How to do the right thing not to spend a lot of time opening the database connection?

Thanks!

    IDbConnectionFactory = connection = new OrmLiteConnectionFactory(TeleportParams.DbConnectionStr, MySqlDialectProvider.Instance)

  ...

    void function1(){
       var db = connection.Open();
       db.Select("some request");
    }

    void function2(){
       var db = connection.Open();
       db.Select("some request");
    }

...

    function1();
    function2();
Mher Arsh
  • 588
  • 4
  • 21

1 Answers1

1

As I understand it in MySQL you cannot specify a connection pool in the connection string.

You can add pooling=false to the connection string to disable Connection Pooling in MySql.

mythz
  • 141,670
  • 29
  • 246
  • 390