Skip to content

Use JdbcTransactionManager in favor of DatasourceTransactionManager #23572

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

Closed

Conversation

mdeinum
Copy link
Contributor

@mdeinum mdeinum commented Oct 2, 2020

Spring 5.3 introduced the JdbcTransactionManager with exception translation
on commit and rollback. With this commit, this transaction manager is going
to be used in favour of the DataSourceTransactionManager used previously.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 2, 2020
@mdeinum mdeinum force-pushed the jdbc-transactionmanager branch from 7558e4f to 0113035 Compare October 2, 2020 07:36
Copy link
Member

@snicoll snicoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I need to get back to the framework doc to better understand this change in the hierarchy. I've added a note for myself in the review, no need to act on it now.

@@ -47,17 +46,17 @@
@ConditionalOnClass({ JdbcTemplate.class, TransactionManager.class })
@AutoConfigureOrder(Ordered.LOWEST_PRECEDENCE)
@EnableConfigurationProperties(DataSourceProperties.class)
public class DataSourceTransactionManagerAutoConfiguration {
public class JdbcTransactionManagerAutoConfiguration {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a breaking change as the name of the class is public API.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did consider changing only the configuration to return a JdbcTransactionManager instead of a DataSourceTransactionManager. I can still do that and revert this rename and only keep the implementation change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted the rename and only kept the config change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks but I explicitly asked you to not act on it

I've added a note for myself in the review, no need to act on it now.

I might have to ask you to undo that based on further analysis.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. I assumed you meant the change from DataSourceTransactionManager to JdbcTransactionManager and not the change in the name of the configuration. If I need to change it again or add a migration path of sorts please let me know.

Spring 5.3 introduced the JdbcTransactionManager with exception translation
on commit and rollback. With this commit this transaction manager is going
to be used in favor of the DataSourceTransactionManager used previously.
@mdeinum mdeinum force-pushed the jdbc-transactionmanager branch from 0113035 to 8a01411 Compare October 2, 2020 08:14
@snicoll snicoll added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 8, 2020
@snicoll snicoll self-assigned this Oct 8, 2020
@snicoll snicoll added this to the 2.4.0-M4 milestone Oct 8, 2020
@snicoll
Copy link
Member

snicoll commented Oct 8, 2020

Unfortunately, I made a typo while copying the reference of the issue. This was fixed by 9293b26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants