Skip to content

Instantly share code, notes, and snippets.

@enujo
Created January 13, 2017 04:39
Show Gist options
  • Save enujo/3ec9a2961aefc4049ed322229e670335 to your computer and use it in GitHub Desktop.
Save enujo/3ec9a2961aefc4049ed322229e670335 to your computer and use it in GitHub Desktop.
transaction을 위한 빈추가
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">
<!-- connection이 가진 tx기능을 spring jdbc에게 위임 -->
<beans:bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<beans:property name="dataSource" ref="dataSource" />
</beans:bean>
<tx:annotation-driven />
<!-- 스프링이 가로채 인터페이스를 만들어 인터페이스를 구현한 클래스를 만든다
proxy 는 무언가를 가로채는 것/ 인터페이스를 쓸것이면 추가 안해도 되고 안쓸거면 써야댄다-->
<tx:annotation-driven proxy-target-class="true"/>
</beans:beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment