• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple instances of hibernate.sessionFactory remain on glassfish server after .war redeployment

Atef Ben Nasser
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey everybody,

I'm in a bit of trouble, I recently started developping a Java application using spring, maven (3.2.3) and glassfish server ( I had to test my webservices so I kept deploying then redeploying my generated war file on glassfish.
After a while I noticed glassfish takes longer and longer to deploy, and then I received an error stating glassfish was unable to get database access. After some more redeploys I had an outofmemory PermGen error. So I started profiling my application.
To my surprise I noticed that everytime i redeployed, old instances of classes were still active and were not deleted as it was supposed to happen. Among which are the webappclassLoader and the hibernate.SessionFactoryImpl, resulting hence in the weird behavior I witnessed during the redeployment.
See the picture attached for the profiling result and the 3 instances of hibernate.SessionFactory obtained.

I don't know where to start to solve this issue. I'm a rookie and every help is most welcome.
Thanks in advance !

Sans titre.png
[Thumbnail for Sans titre.png]
Notice the 3 instances of hibernate.sessionFactory I only redeployed once here
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic