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

Closed
spring-projects-issues opened this issue Jul 16, 2018 · 1 comment

Comments

@spring-projects-issues
Copy link
Collaborator

@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 java.io.Serializable from TransactionInterceptor and *TransactionManager. Any one can explain what is the purpose to make them serializable?


No further details from SPR-17044

@spring-projects-issues
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.