- 浏览: 228131 次
- 性别:
- 来自: 深圳
文章分类
最新评论
-
netwelfare:
文章的格式有点乱啊,看起来很费事啊。推荐看这个系列的json教 ...
java 操作JSON -
yangqingandjay:
ijoi刚好一个月[color=orange][align=c ...
spring 定时器配置 -
Jxdwuao:
不错, 很好用
spring 定时器配置 -
1870702720:
3楼说的可以,之前我一直以为想配置在一个定时器中,可是实现不了 ...
spring 定时器配置 -
taiwei.peng:
你可以配置两个定时器,这是我个人的想法,仅供参考。
spring 定时器配置
<?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: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:property-placeholder location="classpath:jdbc.properties" />
<!-- 注解必要的 -->
<context:component-scan base-package="com.soft" />
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<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>
<property name="defaultAutoCommit">
<value>false</value>
</property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.hbm2ddl.auto">none</prop>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.connection.pool_size">5</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.use_sql_comments">true</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">true</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
<prop key="hibernate.hibernate.cache.use_query_cache">true</prop>
</props>
</property>
<property name="packagesToScan">
<list>
<value>com.soft.nvsg.platform.model</value>
</list>
</property>
</bean>
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<!--事物开始-->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<tx:advice id="serviceAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="save*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="del*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="update*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="batchUpdate*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="submit*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="export*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="generate*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="deploy*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="start*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice>
<aop:config proxy-target-class="true">
<aop:pointcut id="servicePointcut" expression="execution(* com.soft.nvsg.platform.service.impl.*.*(..))"/>
<aop:advisor pointcut-ref="servicePointcut" advice-ref="serviceAdvice" order="1"/>
</aop:config>
<!--事物结束-->
</beans>
<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: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:property-placeholder location="classpath:jdbc.properties" />
<!-- 注解必要的 -->
<context:component-scan base-package="com.soft" />
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<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>
<property name="defaultAutoCommit">
<value>false</value>
</property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.hbm2ddl.auto">none</prop>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.connection.pool_size">5</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.use_sql_comments">true</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">true</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
<prop key="hibernate.hibernate.cache.use_query_cache">true</prop>
</props>
</property>
<property name="packagesToScan">
<list>
<value>com.soft.nvsg.platform.model</value>
</list>
</property>
</bean>
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<!--事物开始-->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<tx:advice id="serviceAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="save*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="del*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="update*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="batchUpdate*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="submit*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="export*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="generate*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="deploy*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="start*" propagation="REQUIRED" rollback-for="Throwable"/>
<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice>
<aop:config proxy-target-class="true">
<aop:pointcut id="servicePointcut" expression="execution(* com.soft.nvsg.platform.service.impl.*.*(..))"/>
<aop:advisor pointcut-ref="servicePointcut" advice-ref="serviceAdvice" order="1"/>
</aop:config>
<!--事物结束-->
</beans>
发表评论
-
Elasticsearch 笔记
2019-09-25 15:33 283查询数据结构 GET ibmpdb_hk/_mapping ... -
模块之间调用form 表单提交
2018-11-30 14:11 380package com.soft.util; imp ... -
ELK搭建笔记
2018-11-20 16:41 341一. 安装elasticsearch 1.yum安装 ... -
Mybatis xml 写法
2017-09-28 11:14 541<?xml version="1.0&qu ... -
maven
2017-07-03 14:48 422项目中pom.xml 文件 <repositorie ... -
qq 微信第三方登录
2017-06-20 15:53 0QQ互联 https://connect.qq.com ... -
Active Mq 扫盲
2017-05-17 19:33 3591.下载ActiveMQ 去官方网站下载:http://a ... -
金融知识点
2017-04-15 16:24 0国信证券地址 http://weixin.guosen.c ... -
java 集合初始化
2017-01-04 14:55 393ArrayList1.ArrayList构造一个默认初始容 ... -
log 4j
2017-09-28 10:51 360### set log levels ### log4j ... -
POI 导出Excel
2016-08-15 11:07 435import java.io.OutputStream; ... -
demo
2016-07-29 17:17 0<div class="iteye-blog- ... -
ETL
2016-05-09 11:25 3081.在D 视图下创建 数据源 在工具栏中找到sourc ... -
java 配置linux 启动节点
2016-04-28 17:06 675source ../jar.cfg nohup java ... -
搭建框架
2016-02-29 15:41 0package com.soft.util; import ... -
Java 对集合类的操作缓存
2015-05-12 15:08 1656public class CapacityGrapCache ... -
hibernate 分页方法
2015-04-03 16:09 771@Repository public class BulkCa ... -
java 开发 oracle分页通用方法
2014-11-21 15:03 716package com.richsum.hyoa.dao.im ... -
Hibernate 注解映射联合主键的三种方式
2012-10-31 10:27 1074联合主键用Hibernate注解映射方式主要有三种:第一、将联 ... -
jdbc 操作 批量插入数据
2012-10-21 15:20 887package com.soft.dzkj.dao; ...
相关推荐
Spring配置 Spring 配置 映射 加注释!!!!Spring配置 Spring 配置 映射 加注释!!!!
spring配置文件实例
spring配置 spring配置 spring配置 spring配置 spring配置
ssmspring配置ssmspring配置ssmspring配置ssmspring配置ssmspring配置ssmspring配置ssmspring配置ssmspring配置ssmspring配置ssmspring配置ssmspring配置ssmspring配置ssmspring配置ssmspring配置ssmspring配置ssm...
使用Spring配置文件实现AOP
Spring配置文件集合Spring配置文件集合Spring配置文件集合Spring配置文件集合Spring配置文件集合Spring配置文件集合Spring配置文件集合
spring 配置文件 归类 IOC AOPspring 配置文件 归类 IOC AOP
spring配置最佳实践.zip spring配置最佳实践.zip spring配置最佳实践.zip
J2EE javascrip 基础知识,MVC spring 配置
spring 配置c3p0 的配置文件 注意是 配置文件
spring配置JNDI数据源
连接MYSQL数据库,SPRING配置文件示例。
spring配置文件详解,Spring的applicationContext.xml文件代码:
spring配置文件加密实现
spring配置文件详解,交你如何理解spring,熟练运用spring
spring配置文件spring配置文件spring配置文件spring配置文件spring配置文件spring配置文件spring配置文件spring配置文件spring配置文件spring配置文件spring配置文件spring配置文件spring配置文件spring配置文件...
spring配置的简单案例.zip spring配置的简单案例.zip spring配置的简单案例.zip spring配置的简单案例.zip spring配置的简单案例.zip spring配置的简单案例.zip spring配置的简单案例.zip spring配置的简单案例.zip ...
Spring配置全书 关于Spring的配置 Spring Framework总是不断的改变着Java企业开发的方向,它用一种松耦合的方式来配置和组装应用程序对象和业务对象,比以往的Java企业开发来的更加简洁。一旦你开发了基于Spring...
spring 配置 文件