I am having a problem with Hibern8IDE where, if I get some syntax error in the HQL, I seem to have to restart Hibern8IDE in order to do more work. Looking at the code, I see that when an error occurs, the session for the page is released.
The example is:
Run a HQL query with a syntax problem, and get:
Code:
Hibernate: select physicianp0_.procedureTypeId as x0_0_, physicianp0_.staffId as x1_0_, max(physicianp0_.effectiveDate) as x2_0_ from PhysicianPreferenceCard physicianp0_ where (physicianp0_.procedureTypeId=248 )and(physicianp0_.effectiveDate<='01/31/2004' ) group by physicianp0_.procedureTypeId , physicianp0_.staffId
released session
Hibernate: select physicianp0_.procedureTypeId as x0_0_, physicianp0_.staffId as x1_0_, max(physicianp0_.effectiveDate) as x2_0_ from PhysicianPreferenceCard physicianp0_ where (physicianp0_.procedureTypeId=248 )and(physicianp0_.effectiveDate<='01/31/2004' ) group by physicianp0_.procedureTypeId , physicianp0_.staffId , xxx
12:07:03,593 WARN JDBCExceptionReporter:38 - SQL Error: 0, SQLState: 42703
12:07:03,593 ERROR JDBCExceptionReporter:46 - ERROR: column "xxx" does not exist
12:07:03,593 WARN JDBCExceptionReporter:38 - SQL Error: 0, SQLState: 42703
12:07:03,593 ERROR JDBCExceptionReporter:46 - ERROR: column "xxx" does not exist
12:07:03,609 ERROR JDBCExceptionReporter:38 - Could not execute query
org.postgresql.util.PSQLException: ERROR: column "xxx" does not exist
If I now fix the HQL, so that it is correct, and rerun the query, I get:
Code:
Hibernate: select physicianp0_.procedureTypeId as x0_0_, physicianp0_.staffId as x1_0_, max(physicianp0_.effectiveDate) as x2_0_ from PhysicianPreferenceCard physicianp0_ where (physicianp0_.procedureTypeId=248 )and(physicianp0_.effectiveDate<='01/31/2004' ) group by physicianp0_.procedureTypeId , physicianp0_.staffId
12:39:21,578 WARN JDBCExceptionReporter:38 - SQL Error: 0, SQLState: 25P02
12:39:21,578 ERROR JDBCExceptionReporter:46 - ERROR: current transaction is aborted, commands ignored until end of transaction block
12:39:21,578 WARN JDBCExceptionReporter:38 - SQL Error: 0, SQLState: 25P02
12:39:21,578 ERROR JDBCExceptionReporter:46 - ERROR: current transaction is aborted, commands ignored until end of transaction block
12:39:21,578 ERROR JDBCExceptionReporter:38 - Could not execute query
org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
at org.postgresql.util.PSQLException.parseServerError(PSQLException.java:139)
at org.postgresql.core.QueryExecutor.executeV3(QueryExecutor.java:154)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:101)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:43)
at org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:515)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:50)
at org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statement.java:231)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:83)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:794)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:188)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132)
at net.sf.hibernate.loader.Loader.doList(Loader.java:949)
at net.sf.hibernate.loader.Loader.list(Loader.java:940)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:833)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1475)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at net.sf.hibern8ide.HQLQueryPage.getList(HQLQueryPage.java:25)
at net.sf.hibern8ide.Hibern8IDE$9.contentsChanged(Hibern8IDE.java:719)
at net.sf.hibern8ide.Hibern8IDE$9.intervalAdded(Hibern8IDE.java:679)
at javax.swing.AbstractListModel.fireIntervalAdded(AbstractListModel.java:130)
at net.sf.hibern8ide.QueryPageModel.add(QueryPageModel.java:44)
at net.sf.hibern8ide.Hibern8IDE$ExecuteQuery.actionPerformed(Hibern8IDE.java:878)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1767)
Running any other queries gets the same problem.
Any ideas?
Sherman