-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Hibernate 4.3.1 is not releasing resources
PostPosted: Thu Feb 13, 2014 9:53 pm 
Newbie

Joined: Wed Jun 06, 2007 9:14 am
Posts: 14
It seems that Hibernate 4.3.1 introduced a bug. I create the connection in my application with:

Code:
EntityManagerFactory connection = Persistence.createEntityManagerFactory(...)


but even if the createEntityManagerFactory method fails with an exception, the service registry remains open. However, as you could see from the above code, I cannot terminate my application because as the method didn't succeed the variable connection wasn't assigned (it is null), so I cannot call connection.close() that would destroy the service registry. It seems that this is really a bug, because how will I be able to release resources without resorting to a hack, like using specific Hibernate APIs from a JPA application?

I'm not the only one to have a problem with this issue. Have a look at this discussion:

http://stackoverflow.com/questions/21645516/program-using-hibernate-does-not-terminate

I think that the Hibernate team should have a look at this.

Marcos


Top
 Profile  
 
 Post subject: Re: Hibernate 4.3.1 is not releasing resources
PostPosted: Tue Feb 18, 2014 6:28 pm 
Newbie

Joined: Wed Jun 06, 2007 9:14 am
Posts: 14
This is serious. This is happening. It is a huge bug. You can test if for yourself and confirm. And yet no one seems to care.

Marcos


Top
 Profile  
 
 Post subject: Re: Hibernate 4.3.1 is not releasing resources
PostPosted: Mon Feb 24, 2014 7:31 am 
Newbie

Joined: Mon Feb 24, 2014 7:28 am
Posts: 2
Same problem here.
http://stackoverflow.com/questions/21943526/hibernate-app-doesnt-close-after-crash


Top
 Profile  
 
 Post subject: Re: Hibernate 4.3.1 is not releasing resources
PostPosted: Mon Feb 24, 2014 4:09 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi Marcos,
good catch, thanks for the heads up!

I've created https://hibernate.atlassian.net/browse/HHH-8998
Feel free to report such issues on JIRA directly.

Hi cscleison,
sorry but no that's not a Hibernate bug, you're in charge of closing the resources you open. I've replied on stackoverlow as well to avoid confusing other people, please flag it as a correct answer, that would be helpful to others.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Hibernate 4.3.1 is not releasing resources
PostPosted: Tue Feb 25, 2014 4:53 pm 
Newbie

Joined: Mon Feb 24, 2014 7:28 am
Posts: 2
Hi Sanne,
Thank you for your feedback. I was in doubt whether it was really a bug or my fault.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.