New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.0.0] Transaction is not persisted because commit is not called #12
Comments
|
I was not familiar with MariaDB versioning and I only just noticed that |
|
Update: I connected to the same DB hosted on AWS with MariaDB version |
|
thanks for detailed reporting. I'll investigate the issue |
in case using transaction commit/rollback or savepoint, transaction might be not rollback / persisted. Connector check server status before issuing a command or not. Problem is that when using flux concat, this verification occurs before previous command in flux are send, making this validation erroneous
|
Hello, I've tried version 1.0.1 and I can confirm that the issue has been resolved. |
|
I may have the same problem. when I use the annotation of spring boot The following dependencies: |
When running update statements in transaction, changes are executed successfully but are not persisted as they are not committed.
Description of the problem
I'm studying r2dbc-client implementation to understand how clients are being built and I decided to test it against my local MariaDB databse of version 10.1.34 (later I managed to reproduce it on 10.4.13 hosted on AWS).
Statements executed in auto commit mode worked. However, when I run statement in transaction, it was executed successfully, but results were not persisted in database. When checking the table, I could see that while no new rows were inserted,
AUTO_INCREMENTvalue was increased by 1.I tried downgrading driver to
0.8.4-rc, but the behavior was the same. However, when swapping driver with r2dbc-mysql, it worked as expected. My assumption therefore is that client and database are working as expected and it's the driver that is faulty.It's worth noting that I used this driver in Spring WebFlux application and had no issues with Spring's annotation based transactions.
Investigation
I did a bit of debugging and it seems that
org.mariadb.r2dbc.client.Context#serverStatusis not changed to correct one. Even afterorg.mariadb.r2dbc.client.ClientBase.LockAction#beginTransactionis called, status has value2, which is flag for auto commit. So whenorg.mariadb.r2dbc.client.ClientBase.LockAction#commitTransactionis later called, condition for active transaction is evaluated asfalseand thereforeCOMMITquery is never sent to the database.I would not only expect server status to contain flag for
1( transaction), but also for flag2(auto commit) to be unset, as that would correspond to behavior described by R2DBC SPI.Steps to reproduce
The text was updated successfully, but these errors were encountered: