-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Improve Narayana JDBC helper to create connections when needed for recovery #9679
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
Improve Narayana JDBC helper to create connections when needed for recovery #9679
Conversation
b081c23
to
ee80ade
Compare
I am not keen on merging this in its current form. The Narayana auto-configuration is getting more and more complex. I'd rather remove it in 2.0 if the extra complexity is unavoidable. |
Agreed. Can't we move the spring boot integration back to Narayana itself? I think I'd prefer if it would be released alongside the project rather than Spring Boot. |
@snicoll I did ask @wilkinsona if this would be possible a couple of weeks back. I agree, that it would make things easier both for us and for you to keep things simple in here and keep the complexity in Narayana side. However, as @wilkinsona said this could be problematic in 1.5 brach, because he prefers to keep it on Narayana's 5.5.x branch. Narayana is currently on 5.6.x. |
@gytis agreed. I was talking about Spring Boot 2 actually. This PR used to be assigned to Spring Boot 2 also... |
Would it be doable for 1.5.x branch if I Narayana people would agree to take this logic for 5.5.x? This is just a speculation, I don't know if it's doable in their side. |
@gytis It's hard to say without knowing the exact nature of the changes. 1.5.x is our long-term maintenance branch so we need to try to avoid anything that runs the risk of destabilising things. |
@wilkinsona assuming that configuration with starter would stay here, we would remove 8 classes from this repo and make them available via Maven dependency. It shouldn't make any difference from the user point of view. |
Closing this PR as it seems that guys in Narayana side were able to find a fix without modifying Spring Boot side. Thanks a lot for your time! |
Prior this pull request, database connection were created on
DataSourceXAResourceRecoveryHelper.getXAResources()
call and closed onDataSourceXAResourceRecoveryHelper.recover(TMENDRSCAN)
call. While this workflow is still valid for most of the time, a change in one of Narayana recovery modules, allows commit/rollback calls to appear outside of this workflow. To make sure, that those calls will get through to the database, I've introduced aConnectionManager
, which makes sure that connection is created and closed whenever needed during recovery.