spring-framework
spring-framework copied to clipboard
EMFU#doGetTransactionalEntityManager to check for actual transaction
… rather than just a synchronization. Otherwise, at least SharedEntityManagerCreator will create a 'lingering' EM inside NEVER/NOT_SUPPORTED propagation, which is closed only after exiting from inside that boundary.
I did look at some other usage of isSynchronizationActive, and I'm not sure if it is more proper to use isActualTransactionActive there. I suspect this might be true for a couple of places.
isActualTransactionActive and doGetTransactionalEntityManager seem to be around here since before the recorded history, so we can't say if isActualTransactionActive was added after or before doGetTransactionalEntityManager.