-
Notifications
You must be signed in to change notification settings - Fork 32
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
Transaction Names should be truncated when too long. #264
Comments
MSSQL truncates transaction's name automatically if it exceed 32 characters, so we can simply show warning instead of throwing exception. |
agreed -- that could work as well. The reason i suggested truncating the beginning is that if you have two different methods:
Then truncating the beginning would give both transactions the same name of |
Happy to include a truncation. We might not log this event but rather silently accept the fact that we're truncating the transaction name. The issue originates from a default behavior where you (do/can) not specify the transaction name. Hence we can just remove the obstacle that causes transactions to fail. A natural consequence of truncating is information loss. If the data beforehand would be correct, then we would not run into that issue. |
Bug Report
Current Behavior
When using r2dbc-mssql via spring-r2dbc with
@Transactional
, the name of the transaction is the FQ class name. This cannot be overridden:https://docs.spring.io/spring-framework/docs/current/reference/html/data-access.html#transaction-declarative-attransactional-settings
r2dbc-mssql is correctly limiting the transaction name to 32 characters per https://learn.microsoft.com/en-us/sql/t-sql/language-elements/begin-transaction-transact-sql?view=sql-server-ver16#arguments
As such, we end up with this exception:
Steps to reproduce
Any class like the following will reproduce the problem:
the transaction name here will be
com.company.name.here.SomeServiceClass.theMethod
which is > 32 chars an errors.Possible Solution
Truncate the beginning of the name so that you end up with the last 32 characters (excluding punctuation): i.e.
here.SomeServiceClass.theMethod
The text was updated successfully, but these errors were encountered: