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.
|