I am using Spring 3.1.0.RELEASE, Hibernate 4.0.1.Final and MySQL 5.1. What is a federated data source that I should use? I am currently using (snippet from application context file) ...
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName"> <value>com.mysql.jdbc.Driver</value> </property> <property name="url"> <value>jdbc:mysql://localhost:3306/myproj</value> </property> <property name="username"> <value>myproj</value> </property> <property name="password"> <value>password</value> </property> </bean>
but it is not a federated data source that creates JDBC connections for each call. I used this Hibernate configuration (hibernate.cfg.xml) ...
<hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/myproj</property> <property name="hibernate.connection.username">myproj</property> <property name="hibernate.connection.password">password</property> <property name="hibernate.connection.pool_size">10</property> <property name="show_sql">true</property> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> ...
but due to an error in Spring 3.1.0, I cannot use the hibernate.cfg.xml file when setting up a factory bean session (which I tried to do this: fragment from Spring application context file ...)
<bean class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" id="sessionFactory"> <property name="configLocation"> <value>classpath:hibernate.cfg.xml</value> </property>
source share