-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Hibernate 3.1 giving problem with oracle 10g
PostPosted: Sat Oct 28, 2006 3:03 am 
Newbie

Joined: Tue Oct 11, 2005 3:27 am
Posts: 5
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


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 29, 2006 3:15 am 
Senior
Senior

Joined: Sun Jun 11, 2006 10:41 am
Posts: 164
Did you try this on Oracle 9? It seems that you are using Oracle9 dialect, and maybe it has issues with Oracle 10. Dialects may be very-very specific for performance reasons. If it's worth your while, maybe implement your own dialect, derived from Oracle9Dialect?

(p.s. please rate if this was helpful :-) )


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 29, 2006 6:18 am 
Newbie

Joined: Tue Oct 11, 2005 3:27 am
Posts: 5
thanks for ur reply...i have solved the problem......it was in welllog.hbml.xml i had to change following

<class name="WellLog" table="WellLog" schema="dbo" catalogue="welllog">

after change

<class name="WellLog" table="WellLog" schema="welllog">

as there is not dbo in oracle querying.

ps:org.hibernate.dialect.Oracle9Dialect works well both with 9 and 10g :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.