Hi
I took the example found here :
http://www.gloegl.de/15.html ( hibernate and hsqldb ) and converted it to work for Oracle 9i . It's a simple application. But it's just not working !
Exception ( pretty long :-p )
----------------------------------
....
....
INFO - schema update complete
INFO - cleaning up connection pool: jdbc:oracle:thin:@10.80.122.55:1521:MyDB
INFO - Checking 0 named queries
Hibernate: select SEQ_INCREMENT.nextval from dual
Hibernate: insert into EVENTS (date, eventtitle, uid) values (?, ?, ?)
WARN - SQL Error: 928, SQLState: 42000
ERROR - ORA-00928: missing SELECT keyword
WARN - SQL Error: 928, SQLState: 42000
ERROR - ORA-00928: missing SELECT keyword
ERROR - Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:161)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:226)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:136)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:669)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:293)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
at de.gloegl.road2hibernate.EventManager.storeEvent(EventManager.java:80)
at de.gloegl.road2hibernate.EventManager.main(EventManager.java:18)
Caused by: java.sql.BatchUpdateException: ORA-00928: missing SELECT keyword
at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:459)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:3907)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:57)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:154)
... 9 more
java.lang.RuntimeException: org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at de.gloegl.road2hibernate.EventManager.storeEvent(EventManager.java:86)
at de.gloegl.road2hibernate.EventManager.main(EventManager.java:18)
Caused by: org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:161)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:226)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:136)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:669)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:293)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
at de.gloegl.road2hibernate.EventManager.storeEvent(EventManager.java:80)
... 1 more
Caused by: java.sql.BatchUpdateException: ORA-00928: missing SELECT keyword
at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:459)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:3907)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:57)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:154)
... 9 more
Exception in thread "main"
Hibernate config file
-----------------------
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@<ip here >:1521:MyDB</property>
<property name="hibernate.connection.username">hibernate</property>
<property name="hibernate.connection.password">hibernate</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="show_sql">true</property>
<property name="transaction.factory_class">
org.hibernate.transaction.JDBCTransactionFactory
</property>
<property name="hibernate.cache.provider_class">
org.hibernate.cache.HashtableCacheProvider
</property>
<property name="hibernate.connection.pool_size">3</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<mapping resource="de/gloegl/road2hibernate/Event.hbm.xml"/>
<mapping resource="de/gloegl/road2hibernate/User.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Please note that the connection is absolutely fine. It's the batch update when I try and add a record via a bean called Event.
What can be wrong ??
Help !
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: