我正在使用CGLib(AOP)代理。当ComboPooledDataSource是最终类时,是否有任何解决方法,因为@RefreshScope在最终类上不起作用?Spring @RefreshScope在最终的类上不起作用ComboPooledDataSource
@Bean(name = "portalDataSource", destroyMethod = "close")
@RefreshScope
public DataSource dataSource() Integer iMaxConTimeout) throws Exception {
ComboPooledDataSource cpds = new ComboPooledDataSource();
cpds.setDriverClass("com.mysql.jdbc.Driver"); //loads the jdbc driver
cpds.setJdbcUrl("....");
cpds.setUser("...");
cpds.setPassword("...");
// the settings below are optional -- c3p0 can work with defaults
cpds.setMinPoolSize(iMinDBCons);
cpds.setMaxPoolSize(iMaxDBCons);
cpds.setMaxIdleTime(iMaxConTimeout);
return cpds;
}
最终的类ComboPooledDataSource是c3p0连接池的一部分。
org.hibernate
hibernate-c3p0
5.0.4.Final
2495

被折叠的 条评论
为什么被折叠?



