Skip to content
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

Remove Serializable from TransactionInterceptor and TransactionManager [SPR-17044] #21582

spring-projects-issues opened this issue Jul 16, 2018 · 1 comment
in: data status: declined type: task


Copy link

@spring-projects-issues spring-projects-issues commented Jul 16, 2018

Yanming Zhou opened SPR-17044 and commented

Java serialization is an anti-pattern now, most TransactionManagers rely on DataSource which is not serializable, and neither define serialVersionUID nor readObject() will cause potential exception, I think is time to remove from TransactionInterceptor and *TransactionManager. Any one can explain what is the purpose to make them serializable?

No further details from SPR-17044

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 17, 2018

Juergen Hoeller commented

This is by design for the time being, with transaction managers potentially reconnecting themselves to a given runtime environment. The common resource transaction managers cannot do this but JtaTransactionManager is capable of re-retrieving its JNDI resources and being fully active again, potentially even in a different JVM but in particular on deserialization within the same JVM... for example in a clustered session setup or for serialized sessions on shutdown.

Granted, JTA is certainly as out-of-fashion as serialization is today. At some point we might be able to let go of both... but not within our planning horizon yet.

@spring-projects-issues spring-projects-issues added status: declined in: data type: task labels Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: data status: declined type: task
None yet

No branches or pull requests

2 participants