日期:2014-05-17  浏览次数:20693 次

帮忙看一下
http://bbs.csdn.net/topics/390735960?page=1#post-396983252


现在 把数据库换为  mysql还是和sqlserver2005一样的效果,,,是不是存在 测试数据,,不持久化到数据库?

求板块大神指点迷津
------解决方案--------------------
除了这个之外,在xml里面显示声明事务
<tx:advice id="txadvice" transaction-manager="transactionManager">
<tx:attributes>
 <tx:method name="send*" propagation="REQUIRED"/>
         <tx:method name="time*" propagation="REQUIRED"/>  
        <!--hibernate4必须配置为开启事务 否则 getCurrentSession()获取不到-->  
        <tx:method name="get*" propagation="REQUIRED" read-only="true" />  
        <tx:method name="count*" propagation="REQUIRED" read-only="true" />  
        <tx:method name="find*" propagation="REQUIRED" read-only="true" />  
        <tx:method name="list*" propagation="REQUIRED" read-only="true" />  
        <tx:method name="*" read-only="true" />  
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="allManagerMethod"
expression="execution(* *..*.*(..))" />
<aop:advisor pointcut-ref="allManagerMethod" advice-ref="txadvice" />
</aop:config>

主要有几个方面要注意,方法的开头是否已经包含在指定规则中了?
<tx:method name="send*" propagation="REQUIRED"/>
第二:切面点的设置路径是否正确,
下面给出一些常见切入点表达式的例子:
任意公共方法的执行:
execution(public * *(..))
任何一个以“set”开始的方法的执行:
execution(* set*(..))
AccountService 接口的任意方法的执行:
execution(* com.xyz.service.AccountService.*(..))
定义在service包里的任意方法的执行:
execution(* com.xyz.service.*.*(..))
定义在service包或者子包里的任意类的任意方法的执行:
execution(* com.xyz.service..*.*(..))
------解决方案--------------------
自己提交呢?