<!-- Local Apache Commons DBCP DataSource that refers to a combined database --> <!-- (see dataAccessContext-jta.xml for an alternative) --> <!-- The placeholders are resolved from jdbc.properties through --> <!-- the PropertyPlaceholderConfigurer in applicationContext.xml --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName"><value>com.mysql.jdbc.Driver</value></property> <property name="url"><value>jdbc:mysql://localhost:3306/jpetstore</value></property> <property name="username" ><value>root</value></property> <property name="password" ><value>123456</value></property> </bean>
<!-- Transaction manager for a single JDBC DataSource --> <!-- (see dataAccessContext-jta.xml for an alternative) --> <bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager"> <property name="sessionFactory"> <ref local="sessionFactory"/> </property> </bean>
<!-- this bellow is hibernate configuration for srx test-->
<!-- Transaction advice definition, based on method name patterns. Defaults to PROPAGATION_REQUIRED for all methods whose name starts with "insert" or "update", and to PROPAGATION_REQUIRED with read-only hint for all other methods. --> <tx:advice id="txAdvice"> <tx:attributes> <tx:method name="insert*"/> <tx:method name="update*"/> <tx:method name="*" read-only="true"/> </tx:attributes> </tx:advice> </beans>