我在spring 中 配置 hibernate transcation ...
<bean id="txProxyTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="myTransactionManager"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="create*">PROPAGATION_REQUIRED,-com.laoer.bbscs.exception.BbscsException</prop>
<prop key="save*">PROPAGATION_REQUIRED,-com.laoer.bbscs.exception.BbscsException</prop>
<prop key="remove*">PROPAGATION_REQUIRED,-com.laoer.bbscs.exception.BbscsException</prop>
<prop key="update*">PROPAGATION_REQUIRED,-com.laoer.bbscs.exception.BbscsException</prop>
<prop key="del*">PROPAGATION_REQUIRED,-com.laoer.bbscs.exception.BbscsException</prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>我的意思是想 所有的服务层都继承 上面的 transaction 模板,, 但我配置像下面的东西 就报错,,
报的错误 比较奇怪 是 所找不到 url 对应 驱动,, ,不配置继承,直接配置到上面的模板里面 就能正常运行 。 <bean id="userService" parent="txProxyTemplate">
<property name="target">
<ref bean="userTarget"/>
</property>
</bean>
不知道大家有没有遇到这个情况,,,,,帮忙解决一下
<bean id="txProxyTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="myTransactionManager"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="create*">PROPAGATION_REQUIRED,-com.laoer.bbscs.exception.BbscsException</prop>
<prop key="save*">PROPAGATION_REQUIRED,-com.laoer.bbscs.exception.BbscsException</prop>
<prop key="remove*">PROPAGATION_REQUIRED,-com.laoer.bbscs.exception.BbscsException</prop>
<prop key="update*">PROPAGATION_REQUIRED,-com.laoer.bbscs.exception.BbscsException</prop>
<prop key="del*">PROPAGATION_REQUIRED,-com.laoer.bbscs.exception.BbscsException</prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>我的意思是想 所有的服务层都继承 上面的 transaction 模板,, 但我配置像下面的东西 就报错,,
报的错误 比较奇怪 是 所找不到 url 对应 驱动,, ,不配置继承,直接配置到上面的模板里面 就能正常运行 。 <bean id="userService" parent="txProxyTemplate">
<property name="target">
<ref bean="userTarget"/>
</property>
</bean>
不知道大家有没有遇到这个情况,,,,,帮忙解决一下
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货