Move synchronization point creation just before transaction begins to enable routing datasources to act on transaction definition [SPR-16876] #21415
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Kaan Ozdokmeci opened SPR-16876 and commented
In org.springframework.transaction.support.AbstractPlatformTransactionManager#getTransactionmethod,
the synchronization point is created after the transaction is created and a connection is attached to it via the doBegin method.
Having the synchronization point created afterwards prevents the ability to utilize an AbstractRoutingDatasource that is able to pick between read-only and read-write datasources for the transaction by inspecting
org.springframework.transaction.support.TransactionSynchronizationManager#isCurrentTransactionReadOnly
when determining the appropriate datasource.
Is there any reason not to move synchronization point creation before the doBegin method so that routing datasources can act on the transaction definition?
If not happy to send a PR.
No further details from SPR-16876
The text was updated successfully, but these errors were encountered: