
org.apache.ctakes.ytex.beans-datasource.xml Maven / Gradle / Ivy
The newest version!
<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:org/apache/ctakes/ytex/ytex-default.properties </value> <value>classpath:org/apache/ctakes/ytex/ytex.properties</value> <value>classpath:org/apache/ctakes/ytex/ytex-umls.properties</value> </list> </property> <property name="systemPropertiesModeName"> <value>SYSTEM_PROPERTIES_MODE_OVERRIDE</value> </property> </bean> <bean id="ytexProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <property name="location" value="classpath:org/apache/ctakes/ytex/ytex.properties" /> </bean> <bean id="hibernateProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <property name="properties"> <props> <prop key="hibernate.dialect">${hibernate.dialect}</prop> <!-- <prop key="hibernate.show_sql">true</prop> --> <prop key="hibernate.default_schema">${db.schema}</prop> <prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory </prop> <prop key="hibernate.cache.use_query_cache">true</prop> <!-- to enable batch inserts --> <prop key="hibernate.jdbc.batch_size">${hibernate.jdbc.batch_size}</prop> <prop key="hibernate.order_inserts">${hibernate.order_inserts}</prop> <prop key="hibernate.order_updates">${hibernate.order_updates}</prop> <prop key="net.sf.ehcache.configurationResourceName">org/apache/ctakes/ytex/kernel/ehcache.xml</prop> <prop key="hibernate.cache.provider_configuration_file_resource_path">org/apache/ctakes/ytex/kernel/ehcache.xml</prop> <!-- <prop key="hibernate.connection.isolation">1</prop> --> </props> </property> </bean> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="${db.driver}" /> <property name="url" value="${db.url}" /> <property name="username" value="${db.username}" /> <property name="password" value="${db.password}" /> <!-- <property name="defaultTransactionIsolation" value="1" /> --> </bean> <!-- the transactional advice (what 'happens'; see the <aop:advisor/> bean below) we use read uncommitted because when we annotate documents in parallel, we read and write to the document table. However, the txs don't interfere with eachother - they don't touch the same rows - so there is no need to serialize the transactions. serializing the transactions will actually cause deadlocks --> <!-- we have to use the old-fashioned transaction aspect configuration because no variable substitution in tx:method element <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="*" propagation="REQUIRED" isolation="${db.isolationLevel}" /> </tx:attributes> </tx:advice> --> <bean id="txAdvice" class="org.springframework.transaction.interceptor.TransactionInterceptor"> <property name="transactionManager" ref="transactionManager" /> <property name="transactionAttributes"> <props> <prop key="*">PROPAGATION_REQUIRED,ISOLATION_${db.isolationLevel} </prop> </props> </property> </bean> <bean id="txTemplate" class="org.springframework.transaction.support.TransactionTemplate"> <property name="transactionManager" ref="transactionManager" /> <property name="propagationBehaviorName" value="PROPAGATION_REQUIRED" /> <property name="isolationLevelName" value="ISOLATION_${db.isolationLevel}" /> </bean> <bean id="txTemplateNew" class="org.springframework.transaction.support.TransactionTemplate"> <property name="transactionManager" ref="transactionManager" /> <property name="propagationBehaviorName" value="PROPAGATION_REQUIRES_NEW" /> <property name="isolationLevelName" value="ISOLATION_${db.isolationLevel}" /> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> </beans>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy