Release Notes for MariaDB Connector/C++ 1.1.1
This page is part of MariaDB's MariaDB Documentation.
The parent of this page is: Release Notes for MariaDB Connector/C++ 1.1
Topics on this page:
MariaDB Connector/C++ is the interface between C++ applications and MariaDB Server. MariaDB Connector/C++ enables development of C++ applications using a JDBC-based API, which is also used by MariaDB Connector/J. This is the second Beta release of MariaDB Connector/C++.
MariaDB Connector/C++ 1.1.1 was released on 2022-03-04. This release is of Beta maturity, and should not be used with production workloads.
MariaDB Connector/C++ in its current implementation uses the MariaDB protocol via the MariaDB Connector/C API. Connector/C 3.3.0 is used in this release.
MariaDB Connector/C++ 1.1.1 adds the ability to create a connection pool to improve usage of resources and to provide a faster way to connect to the server. (CONCPP-2)
The new class
MariaDbDataSourcehas been added to enable creating a connection pool. The pool is created when
MariaDbDataSource::getConnectionis called the first time.
sql::mariadb::MariaDbDataSource ds("jdbc:mariadb://localhost:3306/db?minPoolSize=2&maxPoolSize=8&maxIdleTime=900&poolValidMinDelay=2000"); ds.setUser("root"); ds.setPassword("myPassword"); // connect to server using the credentials from the pool std::unique_ptr<sql::Connection> conn1(ds.getConnection()); std::unique_ptr<sql::Connection> conn2(ds.getConnection());
New connection properties have been added to configure the pool:
The minimum number of connections to be kept in the pool (defaults to
The maximum number of physical connections that the pool can contain (defaults to 8)
maxIdleTimeThe maximum amount of time in seconds that connections above
minPoolSizecan stay in the pool if not used. This value must always be at least 45 seconds lower than the @wait_
timeoutvalue.Default: 600 in seconds(=10 minutes), minimum value is 60 seconds
The period of time in milliseconds after returning a connection to the pool, during which the connection is considered to be good and does not require validation on return to the application. 0 means validation is done each time the connection is requested (defaults to 1000)
Default for option
useResetConnectionhas been changed from
true. The change of default to
Connection::reset()method issues a connection reset command at the server by default. Previous default value of
Connection::reset()did a "soft reset" and set only certain system variables and connection parameters according to the connection properties.
New node failover support. (CONCPP-4)
An application can supply more than one host to use for connection. An individual port number can be specified for each host:
sql::SQLString failoverUrl("jdbc:mariadb:sequential://localhost:3306,failoverhost1.com,[::1]:3307,failoverhost2.com:3307/db?user=root&password=someSecretWord"); std::unique_ptr<Connection> conn(DriverManager::getConnection(failoverUrl));
MariaDB Connector/C++ 1.1 will always try to connect to the first host in the list. Other hosts in the list will be used if a tried host cannot be reached.
LOAD DATA LOCAL INFILEis not allowed by default. It can be switched on by using the
allowLocalInfileproperty. (CONCPP-93, CONCPP-94)