為什麼使用com.mchange.v2.c3p0.ComboPooledDataSource配置數據源,
bean的id只能為dataSource,我將id改成dataSource2之後就報錯;
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'dataSource2' of bean class [org.springframework.orm.hibernate4.LocalSessionFactoryBean]: Bean property 'dataSource2' is not writable or has an invalid setter method. Did you mean 'dataSource'?
因為屬性名稱本質上是類中定義的成員變量的名稱,不能隨便更改的。