ssm-事务--使用配置文件方式进行配置,使用注解进行使用

简介: ssm-事务--使用配置文件方式进行配置,使用注解进行使用

配置文件内容:


文件名称:applicationContext-tx.xml


<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
    <!--事务注解-->
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>
    <!--开启事务-->
    <tx:annotation-driven transaction-manager="transactionManager"/>
</beans>
相关文章
|
1月前
ssm使用全注解实现增删改查案例——showEmp.jsp
ssm使用全注解实现增删改查案例——showEmp.jsp
9 0
|
1月前
ssm使用全注解实现增删改查案例——showDept.jsp
ssm使用全注解实现增删改查案例——showDept.jsp
11 0
|
1月前
ssm使用全注解实现增删改查案例——web.xml
ssm使用全注解实现增删改查案例——web.xml
9 0
|
1月前
ssm使用全注解实现增删改查案例——applicationContext.xml
ssm使用全注解实现增删改查案例——applicationContext.xml
10 0
|
1月前
ssm使用全注解实现增删改查案例——EmpServiceImpl
ssm使用全注解实现增删改查案例——EmpServiceImpl
14 0
|
1月前
ssm使用全注解实现增删改查案例——DeptServiceImpl
ssm使用全注解实现增删改查案例——DeptServiceImpl
10 0
|
1月前
ssm使用全注解实现增删改查案例——IEmpService
ssm使用全注解实现增删改查案例——IEmpService
11 0
|
1月前
ssm使用全注解实现增删改查案例——IDeptService
ssm使用全注解实现增删改查案例——IDeptService
12 0
|
1月前
ssm使用全注解实现增删改查案例——Emp
ssm使用全注解实现增删改查案例——Emp
22 0
|
1月前
ssm使用全注解实现增删改查案例——Dept
ssm使用全注解实现增删改查案例——Dept
16 0