asyncer-io / r2dbc-mysql

Reactive Relational Database Connectivity for MySQL. The official successor to mirromutth/r2dbc-mysql(dev.miku:r2dbc-mysql).
https://r2dbc.io
Apache License 2.0
196 stars 21 forks source link

[bug] States should be checked in queue #183

Closed mirromutth closed 9 months ago

mirromutth commented 9 months ago

Describe the bug

Currently, MySqlConnection checks transaction state between the Mono.defer is subscribed and Exchangeable is executed.

It may cause some undefined behavior. All states checking will have same problem, like MySqlConnection.isSessionAutoCommit.

I was thinking that transaction state is necessary, like ConnectionImpl#rollback() does, it even throws an exception if connection is not in a transaction.

Firstly, we should remove transaction state checking in MySqlConnection, see also #179 does.

Then we can consider adding proper status checks in Exchangeable and RequestQueue.

Expected behavior

States should be checked in RequestQueue executing Exchangeable instead.