Announcing MariaDB Connector/R2DBC 1.2

We are pleased to announce MariaDB Connector/R2DBC 1.2 as GA (Generally Available).

MariaDB Connector/R2DBC 1.2 now implements the R2DBC 1.0.0 specification. R2DBC operations are non-blocking, which makes the R2DBC API more scalable than Java’s standard JDBC API.

MariaDB Connector/R2DBC 1.2 includes the following new features:

New Timezone Option

Ideally, the Java timezone is set to the same timezone as the server, but that is not assured. A new option timezone is added for those cases, to explicitly set the timezone of the server by setting the  timezone option to either ‘auto’ or to an explicit timezone.

The new timezone option can have 3 types of values:

  • ‘disabled’ (default) : connector doesn’t change timezone.
  • ‘auto’ : connector will set timezone connection variable to java default timezone
  • ‘<a java timezone>’: connector will set connection variable to the specified timezone. Compared to Auto, this avoids having some additional exchange with the server at connection creation.

Examples:

r2dbc:mariadb://user:pwd@localhost:3306/db?timezone=+5:00
r2dbc:mariadb://user:pwd@localhost:3306/db?timezone=auto
r2dbc:mariadb://user:pwd@localhost:3306/db?timezone=America/New_York

The recommended setting for the timezone is ‘auto’. The connector will change the time_zone connection variable to the current java default time zone when connecting. This permits a safe use of server time functions. If the client uses the IANA timezone, the server might have to load time zone information. See mariadb-tzinfo-to-sql and time-zones, those are not filled by default.

Server Redirection

With MariaDB Community Server 11.3.1 a new global variable redirect_url value has been added, supported format:

{mariadb/mysql}://[<user>[:<password>]@]<host>[:<port>]/

When set, all existing connections will be redirected to the designated URL values when appropriate. A connection will only be redirected when no transaction is active.

Example for enabling the redirection:

set @@global.redirect_url="mariadb://somehost:3306/"

The redirection feature is enabled by default. It can be disabled by setting the new option permitRedirect to FALSE, which will result in ignoring the redirection URL.

Resources