Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:3.1
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2150)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2026)
at org.hibernate.loader.Loader.list(Loader.java:2021)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:298)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1020)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at workflowtracker.Tracker.workflowCompleted(Tracker.java:129)
at workflowtracker.Tracker.startNewWorkflow(Tracker.java:213)
at workflowtracker.WorkflowTracker.eventOccured(WorkflowTracker.java:78)
at watchdog.manager.WatchDog.eventOccured(WatchDog.java:63)
at watchdog.monitors.Monitor.eventOccured(Monitor.java:138)
at watchdog.monitors.FileSystemMonitor.monitorAnyFileCreation(FileSystemMonitor.java:133)
at watchdog.monitors.FileSystemMonitor.monitor(FileSystemMonitor.java:88)
at watchdog.monitors.FileSystemMonitor.run(FileSystemMonitor.java:72)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: ORA-00933: SQL command not properly ended
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:799)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1037)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:839)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3316)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3361)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:137)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1676)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:223)
at org.hibernate.loader.Loader.doList(Loader.java:2147)
... 15 more
Hibernate: select welllog0_.wellLogID as wellLogID2_, welllog0_.created as created2_, welllog0_.wellID as wellID2_ from WellLog.dbo.WellLog welllog0_ where welllog0_.wellID='g4yr'
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2150)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2026)
at org.hibernate.loader.Loader.list(Loader.java:2021)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:298)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1020)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at workflowtracker.Tracker.startNewWorkflow(Tracker.java:221)
at workflowtracker.WorkflowTracker.eventOccured(WorkflowTracker.java:78)
at watchdog.manager.WatchDog.eventOccured(WatchDog.java:63)
at watchdog.monitors.Monitor.eventOccured(Monitor.java:138)
at watchdog.monitors.FileSystemMonitor.monitorAnyFileCreation(FileSystemMonitor.java:133)
at watchdog.monitors.FileSystemMonitor.monitor(FileSystemMonitor.java:88)
at watchdog.monitors.FileSystemMonitor.run(FileSystemMonitor.java:72)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: ORA-00933: SQL command not properly ended
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:799)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1037)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:839)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3316)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3361)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:137)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1676)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:223)
at org.hibernate.loader.Loader.doList(Loader.java:2147)
... 14 more
Name and version of the database you are using:Oracle 10G
The generated SQL (show_sql=true): Hibernate: select welllog0_.wellLogID as wellLogID2_, welllog0_.created as created2_, welllog0_.wellID as wellID2_ from WellLog.dbo.WellLog welllog0_ where welllog0_.wellID='g4yr'
Debug level Hibernate log excerpt:
My code was working with MS SQL server but after i changed my configurations to use my code with oracle 10g, afore mentioned exceptions are coming. Tables are not getting created automatically.
Any ideas if I am using a wrong driver or dialect.
An excerpt from my hibernate.cfg.xml
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@192.168.0.99:1521:Oraware</property>
<property name="hibernate.connection.username">fahad</property>
<property name="hibernate.connection.password">prodoc</property>
<property name="hibernate.connection.pool_size">10</property>
<property name="show_sql">true</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
Read this:
http://hibernate.org/42.html