Skip to content

Error 1568 - #25001 - Transaction characteristics can't be changed while a transaction is in progress #380

Closed
@turnik

Description

@turnik

Hi there.

Our team faced issue com.github.jasync.sql.db.mysql.exceptions.MySQLException: Error 1568 - #25001 - Transaction characteristics can't be changed while a transaction is in progress
when using transaction isolation level READ_COMMITED, defined by transaction definition (not MySQL property)

Our research shows that driver sends the following commands to the database

START TRANSACTION;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;

According to MySQL documentation, this order is possible only with GLOBAL or SESSION keyword.
The correct order of commands looks like

SET autocommit = 0;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
START TRANSACTION;

This issue affects all Spring Boot 3 projects with R2DBC version > 0.9.0 and JAsync MySQL driver.
Fix in #379

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions