Info:
Hibernate Version: 2.1 final
Database: Oracle 9.2(Created Table EVENTS)
JDK: 1.4.2
*************************************************************
Mapping file:(Event.hbm.xml)
<hibernate-mapping>
<class name="de.gloegl.road2hibernate.Event" table="EVENTS">
<id name="id" column="uid" type="java.lang.Integer">
<generator class="sequence"/>
</id>
<property name="date" column="ddate"/>
<property name="title" column="eventtitle"/>
</class>
</hibernate-mapping>
*************************************************************
Mapping file:(Hibernate.cfg.xml)
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:oci:@core2_stage.companyfinance.local</property>
<property name="hibernate.connection.username">core_manager</property>
<property name="hibernate.connection.password">core_manager</property>
<property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
<property name="default_schema">core_manager</property>
<property name="show_sql">true</property>
<property name="transaction.factory_class">
net.sf.hibernate.transaction.JDBCTransactionFactory
</property>
<property name="hibernate.cache.provider_class">
net.sf.hibernate.cache.HashtableCacheProvider
</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<mapping resource="de/gloegl/road2hibernate/Event.hbm.xml"/>
</session-factory>
</hibernate-configuration>
*************************************************************
Source Code:
Session session = sessionFactory.openSession();
//Transaction tx = session.beginTransaction();
Event theEvent = new Event();
theEvent.setTitle(title);
theEvent.setDate(theDate);
//session.saveOrUpdateCopy(theEvent, theEvent.getId());
session.save(theEvent);
//tx.commit();
session.flush();
session.close();
*************************************************************
I am trying to execute above in MS-DOS
Error Log in console:
Initializing Hibernate
INFO - Hibernate 2.1 final
INFO - hibernate.properties not found
INFO - using CGLIB reflection optimizer
INFO - configuring from resource: /hibernate.cfg.xml
INFO - Configuration resource: /hibernate.cfg.xml
DEBUG - trying to locate
http://hibernate.sourceforge.net/hibern ... on-2.0.dtd in classpath under n
et/sf/hibernate/
DEBUG - found
http://hibernate.sourceforge.net/hibern ... on-2.0.dtd in classpath
DEBUG - hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver
DEBUG - hibernate.connection.url=jdbc:oracle:oci:@core2_stage.companyfinance.local
DEBUG - hibernate.connection.username=core_manager
DEBUG - hibernate.connection.password=core_manager
DEBUG - dialect=net.sf.hibernate.dialect.Oracle9Dialect
DEBUG - default_schema=core_manager
DEBUG - show_sql=true
DEBUG - transaction.factory_class=net.sf.hibernate.transaction.JDBCTransactionFactory
DEBUG - hibernate.cache.provider_class=net.sf.hibernate.cache.HashtableCacheProvider
DEBUG - hibernate.hbm2ddl.auto=update
DEBUG - null<-org.dom4j.tree.DefaultAttribute@8b819f [Attribute: name resource value "de/gloegl/road2hibernate
/Event.hbm.xml"]
INFO - Mapping resource: de/gloegl/road2hibernate/Event.hbm.xml
DEBUG - trying to locate
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/
hibernate/
DEBUG - found
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
INFO - Mapping class: de.gloegl.road2hibernate.Event -> EVENTS
DEBUG - Mapped property: id -> uid, type: integer
DEBUG - Mapped property: date -> ddate, type: timestamp
DEBUG - Mapped property: title -> eventtitle, type: string
INFO - Configured SessionFactory: null
INFO - Using dialect: net.sf.hibernate.dialect.Oracle9Dialect
INFO - Using Hibernate built-in connection pool (not for production use!)
INFO - Hibernate connection pool size: 20
INFO - using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:oci:@core2_stage.companyfinance.loca
l
INFO - connection properties: {user=core_manager, password=core_manager}
INFO - Running hbm2ddl schema update
INFO - fetching database metadata
DEBUG - total checked-out connections: 0
DEBUG - opening new JDBC connection
DEBUG - created connection to: jdbc:oracle:oci:@core2_stage.companyfinance.local, Isolation Level: 2
INFO - updating schema
INFO - processing one-to-many association mappings
INFO - processing one-to-one association property references
INFO - processing foreign key constraints
INFO - schema update complete
INFO - cleaning up connection pool: jdbc:oracle:oci:@core2_stage.companyfinance.local
Finished Initializing Hibernate
DEBUG - opened session
DEBUG - about to open: 0 open PreparedStatements, 0 open ResultSets
DEBUG - total checked-out connections: 0
DEBUG - using pooled JDBC connection, pool size: 0
DEBUG - prepared statement get: select hibernate_sequence.nextval from dual
Hibernate: select hibernate_sequence.nextval from dual
DEBUG - preparing statement
DEBUG - Sequence identifier generated: 40
DEBUG - done closing: 0 open PreparedStatements, 0 open ResultSets
DEBUG - closing statement
DEBUG - saving [de.gloegl.road2hibernate.Event#40]
DEBUG - flushing session
DEBUG - Flushing entities and processing referenced collections
DEBUG - Processing unreferenced collections
DEBUG - Scheduling collection removes/(re)creates/updates
DEBUG - Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects
DEBUG - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
DEBUG - listing entities:
DEBUG - de.gloegl.road2hibernate.Event{title=78, date=22 June 2004 16:08:47, id=40}
DEBUG - executing flush
DEBUG - Inserting entity: [de.gloegl.road2hibernate.Event#40]
DEBUG - about to open: 0 open PreparedStatements, 0 open ResultSets
DEBUG - prepared statement get: insert into core_manager.EVENTS (ddate, eventtitle, uid) values (?, ?, ?)
Hibernate: insert into core_manager.EVENTS (ddate, eventtitle, uid) values (?, ?, ?)
DEBUG - preparing statement
DEBUG - Dehydrating entity: [de.gloegl.road2hibernate.Event#40]
DEBUG - binding '22 June 2004 16:08:47' to parameter: 1
DEBUG - binding '78' to parameter: 2
DEBUG - binding '40' to parameter: 3
DEBUG - Adding to batch
DEBUG - Executing batch size: 1
DEBUG - SQL Exception
java.sql.BatchUpdateException: ORA-01747: invalid user.table.column, table.column, or column specification
at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:459)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:3907)
at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:54)
at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:118)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2309)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2259)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2185)
at de.gloegl.road2hibernate.EventManager.store(EventManager.java:73)
at de.gloegl.road2hibernate.EventManager.main(EventManager.java:32)
WARN - SQL Error: 1747, SQLState: 42000
ERROR - ORA-01747: invalid user.table.column, table.column, or column specification
WARN - SQL Error: 1747, SQLState: 42000
ERROR - ORA-01747: invalid user.table.column, table.column, or column specification
DEBUG - done closing: 0 open PreparedStatements, 0 open ResultSets
DEBUG - closing statement
DEBUG - SQL Exception
java.sql.BatchUpdateException: ORA-01747: invalid user.table.column, table.column, or column specification
at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:459)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:3907)
at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:54)
at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:118)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2309)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2259)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2185)
at de.gloegl.road2hibernate.EventManager.store(EventManager.java:73)
at de.gloegl.road2hibernate.EventManager.main(EventManager.java:32)
WARN - SQL Error: 1747, SQLState: 42000
ERROR - ORA-01747: invalid user.table.column, table.column, or column specification
WARN - SQL Error: 1747, SQLState: 42000
ERROR - ORA-01747: invalid user.table.column, table.column, or column specification
ERROR - Could not execute JDBC batch update
java.sql.BatchUpdateException: ORA-01747: invalid user.table.column, table.column, or column specification
at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:459)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:3907)
at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:54)
at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:118)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2309)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2259)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2185)
at de.gloegl.road2hibernate.EventManager.store(EventManager.java:73)
at de.gloegl.road2hibernate.EventManager.main(EventManager.java:32)
ERROR - Could not synchronize database state with session
net.sf.hibernate.JDBCException: Could not execute JDBC batch update
at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:125)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2309)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2259)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2185)
Caused by: java.sql.BatchUpdateException: ORA-01747: invalid user.table.column, table.column, or column speci
ication
at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:459)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:3907)
at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:54)
at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:118)
... 5 more
net.sf.hibernate.JDBCException: Could not execute JDBC batch update
at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:125)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2309)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2259)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2185)
at de.gloegl.road2hibernate.EventManager.store(EventManager.java:73)
at de.gloegl.road2hibernate.EventManager.main(EventManager.java:32)
Caused by: java.sql.BatchUpdateException: ORA-01747: invalid user.table.column, table.column, or column speci
ication
at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:459)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:3907)
at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:54)
at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:118)
*************************************************************
Command used for execution
java -classpath .\lib\hibernate2.jar;.\lib\jta.jar;.\lib\ehcache.jar;.\lib\commons-logging.jar;.\lib\classes12.jar;.\lib\cglib2.jar;.\lib\commons-collections.jar;.\lib\dom4j.jar;.\lib\odmg.jar;.\lib\jdbc2_0-stdext.jar;.\bin de.gloegl.road2hibernate.EventManager %1 %2
*************************************************************
I have also tried by keeping Trasaction(net.sf.hibernate.Transaction), that did't help. I am not having any code to set/add for batch updates but error shows BatchupdateException?
What is missing above?.
Appreciate help.
Thanks