Details

    • New Feature
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • None
    • 1.1.1
    • General
    • None

    Description

      The MySQL Connector/C++ is providing a connection pool, so MariaDB Connector/C++ should provide the same. The connection pool should be provided via MariaDB Connector/C, see CONC-353

      UPDATE: As CONC-353 was closed not to be done it should be reviewed to implement a connection pool directly in the C++ connector.

      Attachments

        Activity

          Can't that really be added in the next version? i.e. not in the 1st beta

          Lawrin Lawrin Novitsky added a comment - Can't that really be added in the next version? i.e. not in the 1st beta

          Use of pool may be enabled in “classic” connection methods using `pool` property set to true, like:

          std::unique_ptr<Connection> conn(DriverManager::getConnection("jdbc:mariadb://localhost:3306/db?user=root&password=someSecretWord&pool=true");

          The “new” way is to use DataSource class. MariaDbDataSource class is exposed in the public API:

          ds("jdbc:mariadb://localhost:3306/db”);
          std::unique_ptr<Connection> conn(ds.getConnection("root", "someSecretWord"));

          In this case the pool will be automatically created. In the JDBC, a pool is created if getPooledConnection() is used. These methods are not supported yet, and the pool is created on MariaDbDataSource::getConnection call.
          Another extension to JDBC - the pool can be closed with ds.close()
          Other connection properties to control the pool:

          • minPoolSize - the minimum number of connections always kept in the pool(maxPoolSize value)
          • maxPoolSize - The maximum number of physical connections that the pool
            can contain(default 8)
          • maxIdleTime - The maximum amount of time in seconds that a connection can
            stay in the pool if not used. This value must always be below
            @wait_timeout value - 45s. Default: 600 in seconds
            (=10 minutes), minimum value is 60 seconds
          • poolValidMinDelay - The period of time after putting of the connection to the pool, during
            which the connection is considered to be good and not validated on return to
            the application.
            0 means validation is done each time the connection is requested
            (default 1000)
          Lawrin Lawrin Novitsky added a comment - Use of pool may be enabled in “classic” connection methods using `pool` property set to true, like: std::unique_ptr<Connection> conn(DriverManager::getConnection("jdbc:mariadb://localhost:3306/db?user=root&password=someSecretWord&pool=true"); The “new” way is to use DataSource class. MariaDbDataSource class is exposed in the public API: ds("jdbc:mariadb://localhost:3306/db”); std::unique_ptr<Connection> conn(ds.getConnection("root", "someSecretWord")); In this case the pool will be automatically created. In the JDBC, a pool is created if getPooledConnection() is used. These methods are not supported yet, and the pool is created on MariaDbDataSource::getConnection call. Another extension to JDBC - the pool can be closed with ds.close() Other connection properties to control the pool: minPoolSize - the minimum number of connections always kept in the pool(maxPoolSize value) maxPoolSize - The maximum number of physical connections that the pool can contain(default 8) maxIdleTime - The maximum amount of time in seconds that a connection can stay in the pool if not used. This value must always be below @wait_timeout value - 45s. Default: 600 in seconds (=10 minutes), minimum value is 60 seconds poolValidMinDelay - The period of time after putting of the connection to the pool, during which the connection is considered to be good and not validated on return to the application. 0 means validation is done each time the connection is requested (default 1000)

          People

            Lawrin Lawrin Novitsky
            ralf.gebhardt Ralf Gebhardt
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.