1. PositionLinkage config
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
schema="GCD">
2. save or select
select
positionli0_.clientPositionID as clientPo1_40_,
positionli0_.linkedPositionID as linkedPo2_40_,
positionli0_.CLIENTPVTRSID as CLIENTPV3_40_,
positionli0_.CLIENTPOSITIONID as CLIENTPO1_40_,
positionli0_.LINKEDPVTRSID as LINKEDPV4_40_,
positionli0_.LINKEDPOSITIONID as LINKEDPO2_40_,
positionli0_.LINKAMOUNT as LINKAMOUNT40_,
positionli0_.LINKAGETYPE as LINKAGET6_40_,
positionli0_.CALCTYPE as CALCTYPE40_,
positionli0_.VERSION as VERSION40_,
positionli0_.CREATEDBY as CREATEDBY40_,
positionli0_.CREATIONDATE as CREATIO10_40_,
positionli0_.MODIFIEDBY as MODIFIEDBY40_,
positionli0_.MODIFICATIONDATE as MODIFIC12_40_
from
GCD.POSITIONLINKAGE positionli0_
where
positionli0_.linkedPositionID=?
insert
into
GCD.POSITIONLINKAGE
(CLIENTPVTRSID, CLIENTPOSITIONID, LINKEDPVTRSID, LINKEDPOSITIONID, LINKAMOUNT, LINKAGETYPE, CALCTYPE, VERSION, CREATEDBY, CREATIONDATE, MODIFIEDBY, MODIFICATIONDATE,clientPositionID, linkedPositionID)
values
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
3.exception
09/05/2011 01:47:00, 369 [TIBCO EMS Session Dispatcher (23812)] [ WARN] JDBCExceptionReporter :[77] - SQL Error: 957, SQLState: 42000
09/05/2011 01:47:00, 370 [TIBCO EMS Session Dispatcher (23812)] [ERROR] JDBCExceptionReporter :[78] - ORA-00957: duplicate column name
09/05/2011 01:47:00, 371 [TIBCO EMS Session Dispatcher (23812)] [ERROR] AbstractFlushingEventListener :[301] - Could not synchronize database state with session
org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:92)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:87)
at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:218)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2174)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2610)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:52)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:570)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:651)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:621)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:311)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:117)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy49.processBuyTrade(Unknown Source)
at com.xxx.biz.position.SwapEventHandler.processSwapTrade(SwapEventHandler.java:282)
at com.xxx.biz.position.SwapEventHandler.processSwapTrade(SwapEventHandler.java:255)
at com.xxx.biz.position.SwapEventHandler.processSwapEvent(SwapEventHandler.java:212)
at com.xxx.fmk.gfinet.ems.EventSubscriber.onMessage(EventSubscriber.java:73)
at gfinet.messaging.ems.EMSListener.onMessage(EMSListener.java:98)
at com.tibco.tibjms.TibjmsxSessionImp._submit(TibjmsxSessionImp.java:4088)
at com.tibco.tibjms.TibjmsxSessionImp._dispatchAsyncMessage(TibjmsxSessionImp.java:2216)
at com.tibco.tibjms.TibjmsxSessionImp$Dispatcher.run(TibjmsxSessionImp.java:3612)
Caused by: java.sql.BatchUpdateException: ORA-00957: duplicate column name
at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10698)
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:294)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
... 30 more
4.solution
change config as below
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
schema="GCD">
5.reference
http://www.theserverside.com/discussions/thread.tss?thread_id=14842