<? XML version = "1.0" encoding = "UTF-8"?>
<! Doctype beans public "-// spring // DTD bean // en" "http://www.springframework.org/dtd/spring-beans.dtd">
<Beans>
<! -- Define the Transaction Manager (declarative transaction) -->
<Bean id = "transactionmanager"
Class = "org. springframework. Orm. hibernate3.hibernatetransactionmanager">
<Property name = "sessionfactory" ref = "sessionfactory"/>
</Bean>
<! -- Configure the interceptor -->
<Bean id = "transactioninterceptor"
Class = "org. springframework. transaction. Interceptor. transactioninterceptor">
<Property name = "transactionmanager" ref = "transactionmanager"/>
<! -- Configure transaction properties -->
<Property name = "transactionattributes">
<Props>
<Prop key = "*"> propagation_required </prop>
<! -- <Prop key = "insert *"> propagation_required </prop>
<Prop key = "Update *"> propagation_required </prop>
<Prop key = "delete *"> propagation_required </prop>
<Prop key = "is *"> propagation_required, redonly </prop>
<Prop key = "check *"> propagation_required, redonly </prop>
<Prop key = "get *"> propagation_required, redonly </prop>
-->
</Props>
</Property>
</Bean>
<! -- Intercept by method name -->
<Bean class = "org. springframework. AOP. Framework. autoproxy. beannameautoproxycreator">
<Property name = "beannames">
<List>
<Value> * service </value>
<Value> * manage </value>
</List>
</Property>
<Property name = "interceptornames">
<List>
<Value> transactioninterceptor </value>
</List>
</Property>
</Bean>
<! -- Configure the propagation feature of things. The following is tag control -->
<TX: Advice id = "txadvice" transaction-Manager = "transactionmanager">
<TX: Attributes>
<TX: method name = "insert *" propagation = "required"/>
<TX: method name = "Update *" propagation = "required"/>
<TX: method name = "delete *" propagation = "required"/>
<TX: method name = "is *" propagation = "required" Read-Only = "true"/>
<TX: method name = "check *" propagation = "required" Read-Only = "true"/>
<TX: method name = "get *" propagation = "required" Read-Only = "true"/>
</TX: Attributes>
</TX: Advice>
<! -- Which classes and Methods participate in things -->
<AOP: config>
<AOP: pointcut id = "interceptorpointcuts"
Expression = "execution (* cn.com. Lenovo. Role. Service. *. * (...)"/>
<AOP: Advisor advice-ref = "txadvice"
Pointcut-ref = "interceptorpointcuts"/>
</AOP: config>
</Beans>