Spring 2.5 & Hibernate 3.2 事宜配置

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");
}

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