OpenSessionInViewFilter需要一个根应用程序上下文,所以我添加了一个ContextLoaderListener,并将与非视图相关的配置文件从DispatcherServlet移到它。app-config.xml配置文件包含与数据源相关的bean。Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
我的理解是,DispatcherServlet从根上下文继承bea
我希望我的read方法不使用事务,因为这根本不需要,我只使用@ transaction标记创建/更新方法。但我该怎么做?我有一个非常基本的Spring配置等等..。在我的DAO中注入了SessionFactory,在每种方法中我都调用了sessionFactory.getCurrentSession().doQueryStuff();org.hibernate.HibernateExceptionSession bound to thread, and configuration does not al