读书人

Spring 2.5 amp; Hibernate 3.2 事宜配置

发布时间: 2012-11-11 10:07:57 作者: rapoo

Spring 2.5 & Hibernate 3.2 事务配置

配置的时候要注意:

if (!isExposeTransactionAwareSessionFactory()) {
? // Not exposing a SessionFactory proxy with transaction-aware
? // getCurrentSession() method -> set Hibernate 3.1 CurrentSessionContext
? // implementation instead, providing the Spring-managed Session that way.
? // Can be overridden by a custom value for corresponding Hibernate property.
? config.setProperty(Environment.CURRENT_SESSION_CONTEXT_CLASS, "org.springframework.orm.hibernate3.SpringSessionContext");
}

=================================================================

?URL:http://histos.net/blog/2008/12/on-hibernate-spring-sessions-and-transactions.html

读书人网 >软件架构设计

热点推荐