<!--
? - Application context definition for framework.
?-->
<beans>
?<!-- ========================= RESOURCE DEFINITIONS ========================= -->
?
?<!-- Configurer that replaces ${...} placeholders with values from a properties file -->
?<!-- (in this case, JDBC-related settings for the dataSource definition below) -->
?<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
??<property name="location"><value>/WEB-INF/jdbc.properties</value></property>
?</bean>
?<!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
?<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
??<property name="sessionFactory"><ref bean="sessionFactory"/></property>
?</bean>
?<!-- Transaction manager that delegates to JTA (for a transactional JNDI DataSource) -->
?<!--
?<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"/>
?-->
?<!-- id generator -->
?<bean id="idGenerateService" parent="baseTransactionProxyFactoryBean">
??<property name="target">
???<bean class="cn.rhui.framework.idgenerator.service.IdGenerateServiceImpl" autowire="byName"/>
??</property>?
?</bean>
?<bean id="generate" class="cn.rhui.framework.idgenerator.Generator">
??<property name="idService">
???<ref local="idGenerateService"></ref>
??</property>
??<property name="path"><value>${generator.path}</value></property>
?</bean>
?<!-- end id generator -->
?<!--
??- Transactional proxy for Petclinic's central data access object.
??-
??- Defines specific transaction attributes with "readOnly" markers,
??- which is an optimization that is particularly valuable with Hibernate
??- (to suppress unnecessary flush attempts for read-only operations).
??-
??- Note that in a real-life app with multiple transaction proxies,
??- you will probably want to use parent and child bean definitions
??- as described in the manual, to reduce duplication.
??? -->
?<bean id="baseTransactionProxyFactoryBean" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" abstract="true">
??<property name="transactionManager"><ref local="transactionManager"/></property>
??<property name="transactionAttributes">
???<props>
????<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
????<prop key="select*">PROPAGATION_REQUIRED,readOnly</prop>
????<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
????<prop key="remove*">PROPAGATION_REQUIRED</prop>
????<prop key="save*">PROPAGATION_REQUIRED</prop>
????<prop key="create*">PROPAGATION_REQUIRED</prop>
???</props>
??</property>
?</bean>
</beans>
------------dataAccessCotext-local.xml--------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "<beans>
??? <!-- ========================= owners bean ========================= -->
?<!-- Local DataSource that works in any environment -->
?<!-- Note that DriverManagerDataSource does not pool; it is not intended for production -->
?<!-- See JPetStore for an example of using Commons DBCP BasicDataSource as alternative -->
?<!-- See Image Database for an example of using C3P0 ComboPooledDataSource as alternative -->
?<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
??<property name="driverClassName"><value>${jdbc.driverClassName}</value></property>
??<property name="url"><value>${jdbc.url}</value></property>
??<property name="username"><value>${jdbc.username}</value></property>
??<property name="password"><value>${jdbc.password}</value></property>
?</bean>
?<!-- JNDI DataSource for J2EE environments -->
?<!--
?<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
??<property name="jndiName"><value>java:comp/env/jdbc/petclinic</value></property>
?</bean>
?-->
?<!-- Hibernate SessionFactory -->
?<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
??<property name="dataSource"><ref local="dataSource"/></property>
???<property name="schemaUpdate">
????<value>true</value>
???</property>
??<property name="mappingResources">
???<list>
????<value>cn/rhui/framework/test/domain/Owners.hbm.xml</value>
??????<value>cn/rhui/framework/idgenerator/vo/SysGenerateId.hbm.xml</value>
???</list>
??</property>
??<property name="hibernateProperties">
???<props>
????????? <prop key="hibernate.query.factory_class">org.hibernate.hql.ast.ASTQueryTranslatorFactory</prop>
??????????????????<prop key="hibernate.dbcp.maxActive">100</prop>
????<prop key="hibernate.dbcp.whenExhaustedAction">1</prop>
????<prop key="hibernate.dbcp.maxWait">120000</prop>
????<prop key="hibernate.dbcp.maxIdle">10</prop>
????<prop key="hibernate.dbcp.ps.maxActive">100</prop>
????<prop key="hibernate.dbcp.ps.whenExhaustedAction">1</prop>
????<prop key="hibernate.dbcp.ps.maxWait">120000</prop>
????<prop key="hibernate.dbcp.ps.maxIdle">10</prop>
????<!--prop key="hibernate.dbcp.validationQuery">select 1 from AclUser</prop-->
????<prop key="hibernate.dbcp.testOnBorrow">true</prop>
????<prop key="hibernate.dbcp.testOnReturn">false</prop>
????<prop key="hibernate.dialect">${hibernate.dialect}</prop>
????<prop key="hibernate.connection.pool_size">10</prop>
????<prop key="hibernate.cache.use_query_cache">true</prop>
????<!--prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.Provider</prop-->
????<prop key="hibernate.use_outer_join">true</prop>
????<prop key="hibernate.max_fetch_depth">3</prop>
????<prop key="hibernate.jdbc.fetch_size">100</prop>
????<prop key="hibernate.jdbc.batch_size">30</prop>
????<prop key="hibernate.default_batch_fetch_size">50</prop>
????<prop key="hibernate.show_sql">true</prop>
????<prop key="hibernate.query.substitutions">true 1, false 0, yes 'Y', no 'N'</prop>
???</props>
??</property>
?</bean>
??? <bean id="ownersDao" class="cn.rhui.framework.test.dao.impl.OwnersImpl" autowire="byName"/>
</beans>