Spring4+Hibernate4 事务管理 配置 注解 AOP
sessionFactory.getCurrentSession()
1. Hibernate 自动管理,thread方式实现。需要手动开启和关闭事务。
<property name="current_session_context_class">thread</property>
2. Spring 自动管理,通过AOP或注解实现。自动开启和关闭事务。
<tx:annotation-driven tran
原创
2015-12-25 21:54:07 ·
7229 阅读 ·
0 评论