OpenSessionInViewFilter更新问题
在项目中配置OpenSessionInViewFilter后,首先会出现的问题:
public class MyOpenSessionInViewFilter extends OpenSessionInViewFilter{@Overrideprotected void closeSession(Session session, SessionFactory sessionFactory) {session.flush();session.getTransaction().commit();super.closeSession(session, sessionFactory);}@Overrideprotected Session getSession(SessionFactory sessionFactory)throws DataAccessResourceFailureException {Session session = SessionFactoryUtils.getSession(sessionFactory, true);session.beginTransaction();FlushMode flushMode = getFlushMode();if (flushMode != null) {this.setFlushMode(FlushMode.AUTO);}return session;}}1 楼 sswh 2011-06-28 第1个问题: