I'm using Websphere Application Server 6.1.0.9.
Here's the configuration:
dao.xml: (DAO layer)
Code:
<bean id="txProxyTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref local="transactionManager"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="calcul*">PROPAGATION_SUPPORTS, readOnly</prop>
<prop key="exist*">PROPAGATION_SUPPORTS, readOnly</prop>
<prop key="hasLinked*">PROPAGATION_SUPPORTS, readOnly</prop>
<prop key="is*">PROPAGATION_SUPPORTS, readOnly</prop>
<prop key="load*">PROPAGATION_SUPPORTS, readOnly</prop>
<prop key="get*">PROPAGATION_SUPPORTS, readOnly</prop>
<prop key="search*">PROPAGATION_SUPPORTS, readOnly</prop>
<prop key="lister*">PROPAGATION_SUPPORTS, readOnly</prop>
<prop key="coche*">PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED,-CefiException</prop>
<prop key="delete*">PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED,-CefiException</prop>
<prop key="update*">PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED,-CefiException</prop>
<prop key="save*">PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED,-CefiException</prop>
<prop key="set*">PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED,-CefiException</prop>
<prop key="ajout*">PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED,-CefiException</prop>
<prop key="creer*">PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED,-CefiException</prop>
<prop key="sauvegarde*">PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED,-CefiException</prop>
<prop key="supprime*">PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED,-CefiException</prop>
</props>
</property>
</bean>
<bean id="myDao" parent="txProxyTemplate" scope="singleton">
<property name="target">
<bean class="com.package.myDaoIml">
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
</bean>
</property>
</bean>
bo.xml: (domain layer)
Code:
<bean id="myBo" class="com.package.myBoImpl">
<property name="myDao">
<ref local="myDao" />
</property>
</bean>
service.xml (service layer)
Code:
<bean id="myService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" scope="singleton">
<property name="transactionManager">
<ref local="transactionManager"/>
</property>
<property name="target">
<ref local="myServiceTarget"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="faireSimulationRev">PROPAGATION_REQUIRED, readOnly</prop>
<prop key="sauvegarderSimulationRev">PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED,-CefiException</prop>
</props>
</property>
</bean>
<bean id="myServiceTarget" class="com.package.myServiceImpl">
<property name="myBo">
<ref local="myBo"/>
</property>
</bean>
common configuration:
Code:
<!-- Hibernate SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource" />
</property>
<property name="mappingResources">
<list>
<value>com/package/myObject.hbm.xml</value>
...
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">tmp.pag.SQLServerDialect</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">false</prop>
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheProvider</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.cache.query_cache_factory">org.hibernate.cache.StandardQueryCacheFactory</prop>
<prop key="hibernate.generate_statistics">${hibernate.generate_statistics}</prop>
<prop key="hibernate.cache.use_structured_entries">true</prop>
</props>
</property>
</bean>
<!-- End of Hibernate SessionFactory -->
<!--Transaction Management-->
<bean id="transactionManager" scope="singleton" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
<property name="hibernateManagedSession" value="false" />
</bean>
<!--End of Transaction Management-->
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>jdbc/CEFI_P_MS_MS</value>
</property>
</bean>