Task List
Steps to Reproduce
- run sample app
- see the bootstrap assertion fail
Expected Behaviour
the ChainedTransactionManagerPostProcessor should have been applied and the transactionManager should be instanceof ChainedTransactionManager
Actual Behaviour
org.codehaus.groovy.runtime.powerassert.PowerAssertionError:
assert transactionManager in ChainedTransactionManager
| |
| false
org.grails.orm.hibernate.GrailsHibernateTransactionManager@1ff542a3
the transactionManager is still a GrailsHibernateTransactionManager.
if you debug into the ChainedTransactionManagerPostProcessor, you can see that it when it runs, there is only one transactionManager bean definition, so it is not applied.
reason is likely, that both the ChainedTransactionManagerPostProcessor and the HibernateDatastoreConnectionSourcesRegistrar (which is responsible for creating the secondary transaction managers) are BeanDefinitionRegistryPostProcessors, but only the ChainedTransactionManagerPostProcessor implements Ordered (with Order.HIGHEST_PRECEDENCE), so it runs first.
i guess the HibernateDatastoreConnectionSourcesRegistrar should also be Ordered and the order of ChainedTransactionManagerPostProcessor should be lower than that?
Environment Information
- Operating System: win x64
- Grails Version: 3.3.1, gorm-6.1.7
- JDK Version: oracle 8u131
- Container Version (If Applicable): n/a
Example Application
will be referenced in a minute
Task List
Steps to Reproduce
Expected Behaviour
the
ChainedTransactionManagerPostProcessorshould have been applied and thetransactionManagershould be instanceofChainedTransactionManagerActual Behaviour
the
transactionManageris still aGrailsHibernateTransactionManager.if you debug into the
ChainedTransactionManagerPostProcessor, you can see that it when it runs, there is only onetransactionManagerbean definition, so it is not applied.reason is likely, that both the
ChainedTransactionManagerPostProcessorand theHibernateDatastoreConnectionSourcesRegistrar(which is responsible for creating the secondary transaction managers) areBeanDefinitionRegistryPostProcessors, but only theChainedTransactionManagerPostProcessorimplementsOrdered(withOrder.HIGHEST_PRECEDENCE), so it runs first.i guess the
HibernateDatastoreConnectionSourcesRegistrarshould also beOrderedand theorderofChainedTransactionManagerPostProcessorshould be lower than that?Environment Information
Example Application
will be referenced in a minute