Java Reference
In-Depth Information
Listing 6-31. transaction-config.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: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/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<!-- this is the service object on which the transaction has to be applied -->
<bean name="uwrAppService"
class="com.apress.einsure.business. å
impl.UnderwritingApplicationServiceImpl">
</bean>
<!-- the transactional advice decides what needs to be done -->
<tx:advice id="txAdvice" transaction-manager="txManager">
<!- - More - ->
</tx>
<!-- DataSource -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
<property name="url" value="jdbc:oracle:thin:@eInsureDev:1525:eInsure"/>
<property name="username" value="scott"/>
<property name="password" value="tiger"/>
</bean>
<!-- Platform Transaction Manager, in this case straight jdbc -->
<bean id="txManager"
class="org.springframework.jdbc. å
datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
Search WWH ::




Custom Search