我在用spring配置声明式事务时 用<tx:advice>里面没有属性 自己往里加时 有错误
配置文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Middle tier application context definition for the image database.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
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/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"><bean name="sessionFactory" class="hibernate.HibernateSessionFactory"/><bean name="transaction" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<tx:advice>
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="del*" propagation="REQUIRED"/>
<tx:method name="update" propagation="REQUIRED"/>
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="send*" read-only="true"/>
<tx:method name="find*" read-only="true"/>
<tx:method name="select*" read-only="true"/>
<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice><aop:config>
<aop:pointcut id="persionImpl" expression="execute(* persionImpl.PersionImpl.*(..))"/><aop:advisor id="advice" advice-ref="?" pointcut-ref="persionImpl"/>
</aop:config><bean name="persionImpl" class="persionImpl.PersionImpl"/></beans>希望哪位高手来帮我解决一下?
配置文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Middle tier application context definition for the image database.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
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/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"><bean name="sessionFactory" class="hibernate.HibernateSessionFactory"/><bean name="transaction" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<tx:advice>
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="del*" propagation="REQUIRED"/>
<tx:method name="update" propagation="REQUIRED"/>
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="send*" read-only="true"/>
<tx:method name="find*" read-only="true"/>
<tx:method name="select*" read-only="true"/>
<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice><aop:config>
<aop:pointcut id="persionImpl" expression="execute(* persionImpl.PersionImpl.*(..))"/><aop:advisor id="advice" advice-ref="?" pointcut-ref="persionImpl"/>
</aop:config><bean name="persionImpl" class="persionImpl.PersionImpl"/></beans>希望哪位高手来帮我解决一下?
解决方案 »
- Saas 项目问题
- com.ibm.ws.naming.jndicos.CNContextImpl incompatible with javax.ejb.EJBHome这是怎么了
- Hibernate组建映射问题
- 超级慢,只要加上这个条件查询时。为什么,该如何解决?
- 关于EJB的几个问题
- 请高手指教:用Myeclipse新建的hibernate工程中,执行cfg.buildSessionFactory()总报错
- 请问:Jboss4.0.3sp1作为web容器的问题。高手请进,高分回报
- 介绍本STRUTS书吧!
- 如何统计一个JAVA项目中的代码行数?
- 求救!调试问题!在线等!谢谢先!
- Java mysql latin1编码乱码问题
- 关于开源工作流NOVA BONITA的问题
<!-- 配置事务的传播特性 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="delete*" propagation="REQUIRED"/>
<tx:method name="modify*" propagation="REQUIRED"/>
<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice>
<!-- 那些类的哪些方法参与事务 -->
<aop:config>
<aop:advisor pointcut="execution(* com.oa.manager.*.*(..))" advice-ref="txAdvice"/>
</aop:config>注意红色文字的写法,寻找执行切入点。
<tx:advice>
是什么原因啊 缺包吗? 还是 配置文件头有问题?