org.springframework.dao.DataIntegrityViolationException: Hibernate operation: ORA-00001: unique constraint (CLPM0701.SYS_C00751831) violated
; nested exception is java.sql.BatchUpdateException: ORA-00001: unique constraint (CLPM0701.SYS_C00751831) violated
java.sql.BatchUpdateException: ORA-00001: unique constraint (CLPM0701.SYS_C00751831) violated
at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:367)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:8726)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:57)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:172)
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.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:48)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:659)
at org.hibernate.impl.SessionImpl.prepareQueries(SessionImpl.java:835)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:825)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:782)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at org.springframework.orm.hibernate3.HibernateTemplate$29.doInHibernate(HibernateTemplate.java:748)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:310)
at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:739)
at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:731)
at cn.ccb.faengine.common.dao.hibernate.impl.CommonHibernateDAO.findByHQL(CommonHibernateDAO.java:132)
at cn.ccb.faengine.foundation.workbench.StorageAgentBench.findFinancialReportBOByReqSeqNumAndReportDataTypeCdList(StorageAgentBench.java:1437)
at cn.ccb.faengine.foundation.workbench.StorageAgentBench.initTrendsAssumptionData(StorageAgentBench.java:1323)
at cn.ccb.faengine.foundation.workbench.StorageAgentBench.getEarlistReportEndDate(StorageAgentBench.java:1880)
at cn.ccb.faengine.foundation.workbench.StorageAgentBench.getEarlistHistoricalReportEndDate(StorageAgentBench.java:1939)
at cn.ccb.faengine.foundation.workbench.AccountProcessorBench.generateModelAcctDataListFromRequestAcctDataListWithAnalysisTimeGrainCd(AccountProcessorBench.java:280)
at cn.ccb.faengine.foundation.workbench.AccountProcessorBench$$FastClassByCGLIB$$2545cb63.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:661)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:57)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:606)
at cn.ccb.faengine.foundation.workbench.AccountProcessorBench$$EnhancerByCGLIB$$ce23b723_2.generateModelAcctDataListFromRequestAcctDataListWithAnalysisTimeGrainCd(<generated>)
at cn.ccb.faengine.coreservice.exports.impl.CoreServiceExport.registerFinancialAnalysisRequest(CoreServiceExport.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:57)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
at $Proxy1.registerFinancialAnalysisRequest(Unknown Source)
at faengine.FaengineDelegateImplTest.testRegisterFinancialAnalysisRequest(FaengineDelegateImplTest.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
旧的数据库ID已经有生成了主键ID,可以把SEQUENCE删除,取最大的ID号为 next number ,就可以解决了!