Exception in thread "main" javax.persistence.PersistenceException: org.hibernate.SessionException: Session is closed!
... and you are using Spring transaction management, then the reason might be that your DAO method (the method that threw it and that uses persistence context) is not transactional and it should be:
import org.springframework.transaction.annotation.Transactional; //... @Transactional(readOnly = true) public List<Dog> retrieveAllDogs() { return em.createQuery("from Dog").getResultList(); } //...
See my article on correct setup of Spring 3 & JPA 2.0.
Great Article android based projects
ReplyDeleteJava Training in Chennai
Project Center in Chennai
Java Training in Chennai
projects for cse
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training