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.

Comment From: jhoeller

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.

Comment From: jhoeller

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