I meet a problem,When I use hibernate without Spring,I always write follow configuration in hibernate.cfg.xml:
<property name="current_session_context_class">thread</property>
this bind the seesion to thread.But When I use hibernate togther with Spring,I don't know how to implement same configuration,I also write it in applicationContext.xml,but it doesn't work. throw exception:
org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
Actually I just want to bind session to thread,then I can use sessionfactory's getcurrentSession method,Did someone meet the same problem as me,how to solve it.Thanks a lot