Here's my code:
Code:
Session session = null;
try {
session = openSession();
while(interests.hasNext()) {
PStatUserSelection answer = (PStatUserSelection) interests.next();
session.save(answer);
}
session.flush();
} finally {
closeSession(session);
}
Here's the exception:
Code:
14:43:15,546 WARN [WrappedConnection] Closing a statement you left open, please do your own houseke
eping
java.lang.Exception: STACK TRACE
at org.jboss.resource.adapter.jdbc.WrappedConnection.registerStatement(WrappedConnection.jav
a:805)
at org.jboss.resource.adapter.jdbc.WrappedStatement.<init>(WrappedStatement.java:43)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.<init>(WrappedPreparedStatement.
java:51)
at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java
:211)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:249)
at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:61)
at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:56)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:505)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:432)
at net.sf.hibernate.impl.ScheduledIdentityInsertion.execute(ScheduledIdentityInsertion.java:
29)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:906)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:839)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:757)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:720)
My question: why?