You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a little spring boot service which used r2dbc with the pool.
I have multiple endpoints which at the end are calling code which supports transactions.
Some are readonly (and therefore have no write operations) and some are transactions with readonly=false which does some write operations.
From our logs we realized that we sometimes we got issues with read only transactions trying to do some write operations.
But these issues was happening at code sections which are configured for using "writeable transactions".
We assume that the pool will reuse some connection which had a readonly flag for writeable transactions.
For now as a workaround we removed the read only tx blocks completely and the error is gone.
Steps to reproduce
I guess it might be reproducable if you had a service with readonly and not readonly operations and simulate a high load. However this time i don't have found the time for a "minimal reproducable example project".
Expected behavior/code
Read only transactions should never be used in code which required a transaction of read only = false. Regardless if readonly transactions are used in other sections of the code.
Possible Solution
Check if connection with readonly = true are somehow reused, and if it could happen that they are reused for "writeable transactions". (and then fix it ;))
The text was updated successfully, but these errors were encountered:
Bug Report
Versions
Current Behavior
I have a little spring boot service which used r2dbc with the pool.
I have multiple endpoints which at the end are calling code which supports transactions.
Some are readonly (and therefore have no write operations) and some are transactions with readonly=false which does some write operations.
From our logs we realized that we sometimes we got issues with read only transactions trying to do some write operations.
But these issues was happening at code sections which are configured for using "writeable transactions".
We assume that the pool will reuse some connection which had a readonly flag for writeable transactions.
For now as a workaround we removed the read only tx blocks completely and the error is gone.
Steps to reproduce
I guess it might be reproducable if you had a service with readonly and not readonly operations and simulate a high load. However this time i don't have found the time for a "minimal reproducable example project".
Expected behavior/code
Read only transactions should never be used in code which required a transaction of read only = false. Regardless if readonly transactions are used in other sections of the code.
Possible Solution
Check if connection with readonly = true are somehow reused, and if it could happen that they are reused for "writeable transactions". (and then fix it ;))
The text was updated successfully, but these errors were encountered: