-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate native mySQL problem
PostPosted: Tue Jan 10, 2006 12:24 pm 
Newbie

Joined: Tue Dec 06, 2005 10:13 am
Posts: 17
Hello,

I am working with OpenSessionInView pattern, to give every request it's own session object. After each request I close the session. I have a complete web application working propely.

For the reporting system I use native SQL (MySQL). I get the connection from Hibernate session and execute a query.

For generating the report I first run a query that generates a temporary table (with: CREATE TEMPORARY TABLE temp ...). My SQL temp table should be per connection. Therefore, I assume that the minute I close the connection (using HibernateUtil.closeSession()), the temp table disapears.
But, for some reason the next time I run the query I get an exception telling me the temp table already exists. Am I missing something ? Hibernate does not really closes the connection ?

Thanks in advance,
Bashan.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 6:43 pm 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
I do not think that the db connections are closed at any time. If you use a connection pool your connection will be returned to the pool thats all.

I do not know if a rollback deletes a temp table in mysql. You may try this.

Regards Sebastian

Please rate, if this helped.

_________________
Best Regards
Sebastian
---
Training for Hibernate and Java Persistence
Tutorials for Hibernate, Spring, EJB, JSF...
eBook: Hibernate 3 - DeveloperGuide
Paper book: Hibernate 3 - Das Praxisbuch
http://www.laliluna.de


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.