org.hibernate.HibernateException: No Session found for current thread
getCurrentSession() only makes sense inside a scope of transaction. You need to declare an appropriate transaction manager, demarcate boundaries of transaction and perform data access inside it. For example, as follows: <bean id = “transactionManager” class = “org.springframework.orm.hibernate4.HibernateTransactionManager”> <property name = “sessionFactory” ref = “sessionFactory” /> </bean> . PlatformTransactionManager ptm = context.getBean(PlatformTransactionManager.class); TransactionTemplate tx = … Read more