JDBC driver:MySQL Connector/J 3.1.12
Hibernate version: 3.1.0 or 3.1.1
Source code sniplet:
Code:
HibernateHelper hibernateHelper = HibernateHelper.getInstance();
Session session = hibernateHelper.getSession();
Query getImages = session.createQuery("from " +
ServerOriginalImage.class.getName() + " as image where " +
"image.theme=:theme and image not in " +
"(select gallery.imageCacheEntry.originalImage from " +
ServerImageGalleryEntry.class.getName() + " as gallery)");
getImages.setEntity("theme", theme);
Iterator i = getImages.iterate();
i.next(); // works fine
Query getCanonicalInstance = session.createQuery("from " +
ServerImageCacheManager.class.getName());
ServerImageCacheManager result = (ServerImageCacheManager) getCanonicalInstance.uniqueResult();
i.next(); // fails with "Operation not allowed after ResultSet closed"
For an unknown reason, the 2nd query is causing the ResultSet of the 1st query to close but this code works fine with Hibernate 3.0.5 so I'm thinking it might be a bug. Should I file a JIRA issue?