Java Reference
In-Depth Information
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 straight jdbd -->
<bean id="txManager" class="org.springframework.jdbc. å
datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- other beans -->
</beans>
Note that I have introduced the namespace and schema for simplifying AOP and
transaction configuration. In the previous example, I have assumed the application uses
straight JDBC for persistence and hence configured the DataSourceTransactionManager .
This will be used to apply transactional advice on the POJO application service. If you
want to use another platform transaction manager, it's just a matter of configuration.
As you saw earlier with AOP, an advice needs to be combined with a pointcut to form
an advisor, as shown in Listing 6-31.
Search WWH ::




Custom Search