解决方案 »
- fileOutputstream.write(byte[])写入后的内容,比原文件多
- 站内邮箱功能分析
- 麻烦大家帮我解释下socket和jsp的区别
- 求北京待遇好一点的公司,2天后结贴给分。
- 请问关于j2ee开发问题
- 如何在spring的ApplicationContext.xml文件中配置访问Weblogic的数据源?
- 各位大虾新年好呀!麻烦给看看Struts的问题!
- 推荐几款Linux操作系统,适合做JAVA开发
- LINUX下报仅有的JAVA错误,能判断是什么原因引起的吗?自己判断是线程问题,但具体不清楚
- 我在查看oracle的sql语句是看到这几个陌生的单词
- struts2 <s:hidden>向action传值问题,想把#request的值通过s:hidden传到action
- 有没有大神,帮忙看一下我的程序啊
2:spring AOP自动完成事务的提交和异常回滚
3:你的配置可以啊<prop key="hibernate.current_session_context_class">
org.springframework.orm.hibernate3.SpringSessionContext
</prop> 就是告诉hibernate 事务交由spring管理, 也就是通过aop实现hibernate Session的创建和关闭。
那你aop配置是否对呢? 是否已经切在对应方法上?
那你aop配置是否对呢? 是否已经切在对应方法上?
<!-- 配置事务的传播特性 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="save*" propagation="REQUIRED" read-only="false" />
<tx:method name="delete*" propagation="REQUIRED" read-only="false" />
<tx:method name="update*" propagation="REQUIRED" read-only="false" />
<tx:method name="*" read-only="true" />
</tx:attributes>
</tx:advice>
<!-- 把切面注入到事务中 -->
<aop:config>
<aop:pointcut id="productServiceMethods" expression="execution(* com.ssh.*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="productServiceMethods" />
</aop:config>
然后就是帖子中的baseDao的getCurrentSession抛出异常了,我调用的是save方法,和aop的配置也是相符的
还有如果被aop Interceptorlan拦截到的话, 是可以在方法的行号旁边看aop拦截标识的。 一个类似于"("的符号。Multiple ers at this line
- implements com.xxxx.xxx.xxxService.xxxx
- advised by
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(org.aopalliance.intercept.MethodInvocation)鼠标放到符号上还有上面的提示哦
拦截器没走,而且好像tomcat启动的时候,也没有实例化拦截器,我缺少TransactionInterceptor的配置吗?