-->
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.  [ 4 posts ] 
Author Message
 Post subject: java.sql.BatchUpdateException Problem in access Oracle9.2 DB
PostPosted: Tue Jun 22, 2004 7:32 pm 
Newbie

Joined: Tue Jun 22, 2004 7:11 pm
Posts: 3
Location: San Mateo,CA
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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 23, 2004 11:22 am 
Beginner
Beginner

Joined: Mon Jun 07, 2004 4:21 pm
Posts: 44
Location: Boston
Not sure if you have batching enabled in your configuration:

## set the maximum JDBC 2 batch size (a nonzero value enables batching)

hibernate.jdbc.batch_size 25


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 23, 2004 2:42 pm 
Newbie

Joined: Tue Jun 22, 2004 7:11 pm
Posts: 3
Location: San Mateo,CA
Hi,
Thanks for the tip. I have added batch proprrty to Hibernate.cfg.xml, this eliminated batchupdate exception in log, still no luck.
<property name="jdbc.batch_size">0</property>

I have tried to insert in to directly into table using pl/sql fine no problem.
Now I am getting SQLException

Log:
************************************************************
ERROR - could not insert: [de.gloegl.road2hibernate.Event#59]
java.sql.SQLException: ORA-01747: invalid user.table.column, table.column, or column specification

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:2321)
at oracle.jdbc.oci8.OCIDBAccess.executeFetch(OCIDBAccess.java:1741)
at oracle.jdbc.oci8.OCIDBAccess.parseExecuteFetch(OCIDBAccess.java:1902)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:514)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:489)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:28)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2306)
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:71)
at de.gloegl.road2hibernate.EventManager.main(EventManager.java:32)
ERROR - Could not synchronize database state with session
********************************************************

I am running my test sample with a batch file,
java -classpath .\lib\hibernate2.jar;.\lib\jta.jar;.\lib\ehcache.jar;.\lib\commons-logging.jar;.\lib\ojdbc14.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
************************************************************
In log somehow it's thinking that I am using 'OCI8' in the above log but I am trying to connect Oracle 9i(Using ojdbc14.jar).

Appreciate help.
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 23, 2004 3:47 pm 
Newbie

Joined: Tue Jun 22, 2004 7:11 pm
Posts: 3
Location: San Mateo,CA
I was using reserve word for table coumn, after fixing that working fine.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.