Closed sohoffice closed 2 years ago
I guess we can move the transaction manager bean to a separate auto-configuration class like we do for Datastore (DatastoreTransactionManagerAutoConfiguration
). Then it will be easier to disable it.
@dmitry-s What do you think?
@meltsufin we can create a configuration property spring.data.gcp.firestore.disableTransactionManager
and make the TransactionManager bean conditional on that property.
What do you think?
I would rather move the config to a separate class like we did for Datastore. This will naturely lend itself to a ...enabled
property, as well as become easy to disable with the standard spring.autoconfigure.exclude
mechanism.
Fixed in GoogleCloudPlatform/spring-cloud-gcp#620.
Is your feature request related to a problem? Please describe. I was mixing JPA with GCP firestore and rely on JPA transaction. However, as FirestoreReactiveAutoConfiguration is always enabled by autoconfigure, I'd need to specifically declare which transaction manager to use in
@Transactional
.However, only JPA transaction manager is used, this is a little frustrating. And quite frankly very easily forgotten.
If the
@Transactional
annotation doesn't specify the transaction manager, Spring will complain about too many transaction manager candidates.Describe the solution you'd like If possible, can a property be matched to control whether this bean is needed ?