You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
org.springframework.boot:spring-boot-dependencies:1.3.0.RELEASE
spring 4.2.3
mybatis-3.2.3
mybatis-spring 1.2.3
We need multiple different DataSources and SqlSessionFactorys and so on. So I tried to register them manually in ApplicationListener. However, when I registered the BeanDefinition with type of SqlSessionFactory, I found the transaction rollback do not work.
Actually, I built the BeanDefinition from the Configuration of DefaultSqlSessionFactory built from SqlSessionFactoryBean. I doubt this would be the reason.
The method getBeanDefinition just try to fill the BeanDefinitionBuilder with configuration as the only parameter of addConstructorArgValue and return a proper BeanDefinition.
Actually, it was something like getting a BeanDefinition by getting a Bean. But I'd no idea how to build a right BeanDefinition without the help of SqlSessionFactoryBean.
Please give me some tips, thanks a lot!
The text was updated successfully, but these errors were encountered:
Hi, I think this is something about best practice. Users should not recreate it multiple times I think. My solution is just not trying to recreate it again.
Hi, guys!
In my circumstance:
We need multiple different
DataSource
s andSqlSessionFactory
s and so on. So I tried to register them manually inApplicationListener
. However, when I registered theBeanDefinition
with type ofSqlSessionFactory
, I found the transaction rollback do not work.Actually, I built the
BeanDefinition
from theConfiguration
ofDefaultSqlSessionFactory
built fromSqlSessionFactoryBean
. I doubt this would be the reason.The registration code:
The
getSqlSessionFactoryDefinition
method:The method
getBeanDefinition
just try to fill theBeanDefinitionBuilder
withconfiguration
as the only parameter ofaddConstructorArgValue
and return a properBeanDefinition
.Actually, it was something like getting a
BeanDefinition
by getting aBean
. But I'd no idea how to build a rightBeanDefinition
without the help ofSqlSessionFactoryBean
.Please give me some tips, thanks a lot!
The text was updated successfully, but these errors were encountered: