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

[spring-tx] Unable to override prepareSynchronization of AbstractPlatformTransactionManager from v6.1.0 #32000

Closed
tagorenathv opened this issue Jan 10, 2024 · 2 comments
Assignees
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: regression A bug that is also a regression
Milestone

Comments

@tagorenathv
Copy link

From spring-framework v6.1.0, prepareTransactionStatus() has been changed from protected to private in AbstractPlatformTransactionManager.
With this we are unable to extend JpaTransactionManager to override prepareSynchronization() to set SESSION encrypt.key for new transactions.

Is this intended ? If yes, how to set for latest versions?
Reference doc links: 6.0.9 vs 6.1.0

Thanks in advance.

@tagorenathv tagorenathv changed the title [spring-tx] prepareTransactionStatus() changed to private in AbstractPlatformTransactionManager [spring-tx] Unable to override prepareSynchronization of AbstractPlatformTransactionManager from v6.1.0 Jan 10, 2024
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 10, 2024
@jhoeller
Copy link
Contributor

I assume you mean prepareSynchronization in your first line there as well since that was protected before? Whereas prepareTransactionStatus was protected final and therefore not overridable to begin with.

In any case, this was not entirely intentional, so I'm happy to turn prepareSynchronization back to protected for 6.1.3.

@jhoeller jhoeller added in: data Issues in data modules (jdbc, orm, oxm, tx) type: regression A bug that is also a regression and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 10, 2024
@jhoeller jhoeller self-assigned this Jan 10, 2024
@jhoeller jhoeller added this to the 6.1.3 milestone Jan 10, 2024
@jhoeller
Copy link
Contributor

BTW depending on your initialization needs there, JpaTransactionManager also offers setEntityManagerInitializer with a Consumer<EntityManager> callback as of 5.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

3 participants