记一次springboot多数据源配置后发现的新日志

INFO级别

2020-01-07 16:38:16.380 INFO 812 — [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean ‘org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration’ of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

配置了多数据源事务后产生
该日志的主要意思是代理事务管理器配置bean被提前注册了
经过Junit测试发现没什么大问题

查springIOC源码可得:由于BeanPostProcessor实例化时,自动依赖注入根据类型获得需要注入的Bean时,会将某些符合条件的Bean先实例化,如果此FacotryBean又依赖其他普通Bean,会导致该Bean提前启动,造成"误伤"(无法享受部分BeanPostProcessor的后置处理,例如典型的auto-proxy)

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值