首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > XML SOAP >

ssh框架调整 applicationContext.xml

2012-07-19 
ssh框架整合 applicationContext.xml?xml version1.0 encodingUTF-8?beans xmlnshttp://www.sp

ssh框架整合 applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

<!-- 开启注解配置 -->
<context:annotation-config />
   
<!-- 对指定的包进行组件扫描 --><!-- ##########此处加包模块########### -->
<context:component-scan base-package="com.donglusoft.leavedemo" />
<context:component-scan base-package="com.donglusoft.bacterin" />
<context:component-scan base-package="com.donglusoft.charge" />
<context:component-scan base-package="com.donglusoft.goods" />
<context:component-scan base-package="com.donglusoft.stat" />
<context:component-scan base-package="com.donglusoft.healthcard" />
<context:component-scan base-package="com.donglusoft.hygienemonitor" />
<context:component-scan base-package="com.donglusoft.license" />
<context:component-scan base-package="com.donglusoft.officialdocument" />
<context:component-scan base-package="com.donglusoft.person" />
<context:component-scan base-package="com.donglusoft.rightmanagement" />
<context:component-scan base-package="com.donglusoft.sampletesting" />
<context:component-scan base-package="com.donglusoft.vehicle" />

<!-- 读取配置文件 -->
<bean id="propertyConfigurer" destroy-method="close">
<property name="driverClass" value="${jdbc.driverClassName}" />
<property name="jdbcUrl" value="${jdbc.url}" />
<property name="user" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<!--连接池中保留的最小连接数。-->
<property name="minPoolSize" value="5" />
<!--连接池中保留的最大连接数。Default: 15 -->
<property name="maxPoolSize" value="30" />
<!--初始化时获取的连接数,取值应在minPoolSize与maxPoolSize之间。Default: 3 -->
<property name="initialPoolSize" value="10" />
<!--最大空闲时间,600秒内未使用则连接被丢弃。若为0则永不丢弃。Default: 0 -->
<property name="maxIdleTime" value="600" />
<!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3 -->
<property name="acquireIncrement" value="5" />
<!--JDBC的标准参数,用以控制数据源内加载的PreparedStatements数量。但由于预缓存的statements 
属于单个connection而不是整个连接池。所以设置这个参数需要考虑到多方面的因素。   如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。Default: 0-->
<property name="maxStatements" value="0" />
</bean>

<!-- 用p6spy 在console显示变量绑定后的真实sql 与ResultSet,方便开发 -->
<bean id="dataSource" />
</bean>

<!-- 集成hibernate配置 -->
<bean id="sessionFactory" ref="dataSourceImpl" />
<property name="hibernateProperties" ref="hibernateProperties" />
<property name="mappingLocations">
<list>
<!-- 以下几个jbpm.*.hbm.xml由jBPM自带 -->
<value>classpath:jbpm.repository.hbm.xml</value>
<value>classpath:jbpm.execution.hbm.xml</value>
<value>classpath:jbpm.history.hbm.xml</value>
<value>classpath:jbpm.task.hbm.xml</value>
<value>classpath:jbpm.identity.hbm.xml</value>
<!-- #####华丽丽而又非常华丽丽的分界线#### =====注意可以使用通配符======  ### -->
<value>classpath*:com/donglusoft/leavedemo/entities/*.hbm.xml</value>
<value>classpath*:com/donglusoft/bacterin/domain/*.hbm.xml</value>
<value>classpath*:com/donglusoft/charge/domain/*.hbm.xml</value>
<value>classpath*:com/donglusoft/goods/domain/*.hbm.xml</value>
<value>classpath*:com/donglusoft/healthcard/domain/*.hbm.xml</value>
<value>classpath*:com/donglusoft/hygienemonitor/domain/*.hbm.xml</value>
<value>classpath*:com/donglusoft/license/domain/*.hbm.xml</value>
<value>classpath*:com/donglusoft/officialdocument/domain/*.hbm.xml</value>
<value>classpath*:com/donglusoft/person/domain/*.hbm.xml</value>
<value>classpath*:com/donglusoft/rightmanagement/domain/*.hbm.xml</value>
<value>classpath*:com/donglusoft/sampletesting/domain/*.hbm.xml</value>
<value>classpath*:com/donglusoft/vehicle/domain/*.hbm.xml</value>
</list>
</property>
</bean>
<bean name="hibernateProperties" />
<bean id="processEngine" factory-bean="springHelper" factory-method="createProcessEngine" />

<!-- 模板配置自己写的,不是必须的 -->
<bean id="jbpmTemplate" ref="processEngine"></property>
</bean>

<!-- 数据层用的模板工具,不是必须的 -->
<bean id="hibernateTemplate" ref="sessionFactory"></property>
</bean>

<!-- 事务配置,必须 -->
<bean id="transactionManager" abstract="false" lazy-init="default" autowire="default" dependency-check="default">
<property name="sessionFactory" ref="sessionFactory" />
</bean>

<!-- 切面配置  -->
<aop:config>
<aop:pointcut id="transactionPointcut1" expression="execution(* com.donglusoft.leavedemo.biz.*.*(..))" />
<aop:pointcut id="transactionPointcut2" expression="execution(* com.donglusoft.bacterin.service.*.*(..))" />
<aop:pointcut id="transactionPointcut3" expression="execution(* com.donglusoft.charge.service.*.*(..))" />
<aop:pointcut id="transactionPointcut4" expression="execution(* com.donglusoft.goods.service.*.*(..))" />
<aop:pointcut id="transactionPointcut5" expression="execution(* com.donglusoft.healthcard.service.*.*(..))" />
<aop:pointcut id="transactionPointcut6" expression="execution(* com.donglusoft.hygienemonitor.service.*.*(..))" />
<aop:pointcut id="transactionPointcut7" expression="execution(* com.donglusoft.license.service.*.*(..))" />
<aop:pointcut id="transactionPointcut8" expression="execution(* com.donglusoft.officialdocument.service.*.*(..))" />
<aop:pointcut id="transactionPointcut9" expression="execution(* com.donglusoft.person.service.*.*(..))" />
<aop:pointcut id="transactionPointcut10" expression="execution(* com.donglusoft.rightmanagement.service.*.*(..))" />
<aop:pointcut id="transactionPointcut11" expression="execution(* com.donglusoft.sampletesting.service.*.*(..))" />
<aop:pointcut id="transactionPointcut12" expression="execution(* com.donglusoft.vehicle.service.*.*(..))" />
<aop:pointcut id="transactionPointcut13" expression="execution(* com.donglusoft.leavedemo.service.*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="transactionPointcut1" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="transactionPointcut2" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="transactionPointcut3" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="transactionPointcut4" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="transactionPointcut5" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="transactionPointcut6" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="transactionPointcut7" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="transactionPointcut8" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="transactionPointcut9" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="transactionPointcut10" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="transactionPointcut11" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="transactionPointcut12" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="transactionPointcut13" />
</aop:config>
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="get*" read-only="true" propagation="NOT_SUPPORTED" />
<tx:method name="find*" read-only="true" propagation="NOT_SUPPORTED" />
<tx:method name="*" propagation="REQUIRED" />
<!--
<tx:method name="add*" propagation="REQUIRED" /> <tx:method name="del*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="*"
propagation="REQUIRED" /> <tx:method name="get*" propagation="SUPPORTS" read-only="true" /> <tx:method name="search*" propagation="SUPPORTS" read-only="true" />
-->
</tx:attributes>
</tx:advice>
</beans> 1 楼 chensong215 2011-12-12   我数据库用的是sql server 2008,现在也遇到了这个问题,不知楼主的问题是怎么解决的?

热点排行