출처:
http://www.egovframe.go.kr/wiki/doku.php?id=egovframework:rte:psl:transaction#configuration
http://www.egovframe.go.kr/wiki/doku.php?id=egovframework:rte:psl:transaction:declarative_transaction_management
* xml 정의
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource"/> </bean> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="dbc:mysql://db2:1621/rte"/> <property name="username" value="rte"/> <property name="password" value="xxx"/> <property name="defaultAutoCommit" value="false"/> </bean>
(datasource.xml)
* 사용
@Transactional
public class Foo {
insert();
delete();
load_data();
}