hibernate4 无法保存 不报错

务必检查这个部分。上面这个写法就无法保存,下面的就可以保存。具体技术原因,可以网上搜一下掌握事务配置的具体含义。

 

1 <tx:advice id="txAdvice" transaction-manager="txManager">
2         <tx:attributes>
3             <tx:method name="save*" propagation="REQUIRED" />
4             <tx:method name="update*" propagation="REQUIRED" />
5             <tx:method name="delete*" propagation="REQUIRED" />
6             <tx:method name="login*" propagation="REQUIRED" />
7             <tx:method name="*" read-only="true" />
8         </tx:attributes>
9     </tx:advice>

 

 

 1 <tx:advice id="txAdvice" transaction-manager="txManager">
 2 <tx:attributes>
 3 <tx:method name="save*" propagation="REQUIRED" />
 4 <tx:method name="update*" propagation="REQUIRED" />
 5 <tx:method name="delete*" propagation="REQUIRED" />
 6 <tx:method name="login*" propagation="REQUIRED" />
 7 <tx:method name="executeUpdate*" propagation="REQUIRED" />
 8 <tx:method name="run" propagation="NOT_SUPPORTED" />
 9 <tx:method name="*" read-only="true" />
10 </tx:attributes>
11 </tx:advice>

 

posted @ 2018-06-14 14:20  nanahome  阅读(158)  评论(0编辑  收藏  举报