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 think it could be useful to add R2dbcTransactionManager nested propagation transactions support.
The current r2dbc transaction manager implementation doesn't throw an exception when nested propagation is used "alone", but throw the following exception when a nested propagation is defined while a started transaction is already associate to the current process :
org.springframework.transaction.CannotCreateTransactionException: Could not open R2DBC Connection for transaction; nested exception is java.lang.IllegalStateException: Already value [org.springframework.r2dbc.connection.ConnectionHolder@7b0007f6] for key [ConnectionPool[PostgreSQL]] bound to context
at org.springframework.r2dbc.connection.R2dbcTransactionManager.lambda$null$5(R2dbcTransactionManager.java:227) ~[spring-r2dbc-5.3.25.jar:5.3.25]
The documentation, contain the following statement :
Understanding PROPAGATION_NESTED
PROPAGATION_NESTED uses a single physical transaction with multiple savepoints that it can roll back to. Such partial rollbacks let an inner transaction scope trigger a rollback for its scope, with the outer transaction being able to continue the physical transaction despite some operations having been rolled back. This setting is typically mapped onto JDBC savepoints, so it works only with JDBC resource transactions. See Spring’s DataSourceTransactionManager.
I think they could be used to implement nested propagation support on R2dbcTransactionManager.
I test a rather dirty workarround implementation and it seem to work pretty well.
I think nested propagation give flexibility ; for example, when a part of a process fail, they give the ability to restore the state of the current transaction to it's consistent state, just before the failing part, letting the caller decide to just retry, fail or switch to a fallback.
I would be great if this feature could be supported by build-in spring implementation.
The text was updated successfully, but these errors were encountered:
I think it could be useful to add R2dbcTransactionManager nested propagation transactions support.
The current r2dbc transaction manager implementation doesn't throw an exception when nested propagation is used "alone", but throw the following exception when a nested propagation is defined while a started transaction is already associate to the current process :
The documentation, contain the following statement :
If I'm right, r2dbc use a sigle connection per transaction and offer createSavepoint, rollbackTransactionToSavepoint and releaseSavepoint.
I think they could be used to implement nested propagation support on R2dbcTransactionManager.
I test a rather dirty workarround implementation and it seem to work pretty well.
I think nested propagation give flexibility ; for example, when a part of a process fail, they give the ability to restore the state of the current transaction to it's consistent state, just before the failing part, letting the caller decide to just retry, fail or switch to a fallback.
I would be great if this feature could be supported by build-in spring implementation.
The text was updated successfully, but these errors were encountered: