Oracle:ORA-00001 违反唯一约束条件

    程序跑出下面的异常: ORA-00001: 违反唯一约束条件 (EOMS3.SYS_C0024492),参考下面的文章了解到我的程序可能是序列的问题。(果然是序列产生的最小值设置的太小,将序列值设置大之后,问题解决)原文如下:

    对于java.sql.SQLException: ORA-00001: 违反唯一约束条件,可能是该表的主键唯一性出错,即:主键中已有某个键值,现在又要插入一个同样的值,这样就要报这个异常.  

    在oracle中,主健不能自动生成,不过可以通过“序列”来实现,如果是这样的话,问题很可能就出在“序列”上了;ORACLE表主键ID突然从已经存在的ID值开始自动生成,导致违反主键唯一性约束;可以通过修改“序列”t_seqfactory (自定义序列名)的NEXTID得以解决(以用户表T_XFHJ_LXLB为例):

    先通过,select * from t_seqfactory where tblname='T_XFHJ_LXLB' 查找是否存在'T_XFHJ_LXLB' 这个表名,如果不存在,就要手动添加这条记录;如果存在,它对应的nextid字段上加1,即:

UPDATE t_seqfactory SET NEXTID=40 where tblname='T_XFHJ_LXLB'

 

   解决方案:将序列能够产生的最小值增大。

    原来的创建语句。

    create sequence a_fault_info_SEQ

   minvalue 1

    maxvalue 999999999999999999999999999

    start with 1

    increment by 1

    cache 20;

   修改步骤:

    1、DROP SEQUENCE a_fault_info_SEQ;

    2、create sequence a_fault_info_SEQ

      minvalue 1000

       maxvalue 999999999999999999999999999

       start with 1

       increment by 1

       cache 20;

 

严重: ORA-00001: 违反唯一约束条件

05-04

插入数据的时候报的这个问题,大家给看看。rn[code=XML]rnHibernate: rn selectrn hibernate_sequence.nextval rn fromrn dualrnHibernate: rn insert rn intorn MAP_T_RELAY_STATIONrn (DATA_GUID, RELAY_STATION_NAME, X, Y, RELAY_STATION_ID) rn valuesrn (?, ?, ?, ?, ?)rn2011-5-4 9:21:48 org.hibernate.util.JDBCExceptionReporter logExceptionsrn警告: SQL Error: 1, SQLState: 23000rn2011-5-4 9:21:48 org.hibernate.util.JDBCExceptionReporter logExceptionsrn严重: ORA-00001: 违反唯一约束条件 (JMJL.MAP_T_RELAY_STATION_KEY)rnrn2011-5-4 9:21:48 org.hibernate.util.JDBCExceptionReporter logExceptionsrn警告: SQL Error: 1, SQLState: 23000rn2011-5-4 9:21:48 org.hibernate.util.JDBCExceptionReporter logExceptionsrn严重: ORA-00001: 违反唯一约束条件 (JMJL.MAP_T_RELAY_STATION_KEY)rnrn2011-5-4 9:21:48 org.hibernate.event.def.AbstractFlushingEventListener performExecutionsrn严重: Could not synchronize database state with sessionrnorg.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch updatern at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)rn at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)rn at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)rn at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)rn at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)rn at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)rn at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)rn at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)rn at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)rn at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)rn at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655)rn at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:709)rn at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678)rn at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)rn at $Proxy0.saveRelayStation(Unknown Source)rn at com.adam.dev.service.RelayStationService.saveRelayStation(RelayStationService.java:37)rn at com.adam.dev.action.RelayStationAction.saveRelayStation(RelayStationAction.java:63)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:324)rn at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)rn at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)rn at org.apache.struts.actions.MappingDispatchAction.execute(MappingDispatchAction.java:166)rn at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110)rn at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)rn at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)rn at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)rn at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)rn at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)rn at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)rn at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)rn at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)rn at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)rn at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)rn at java.lang.Thread.run(Thread.java:534)rnCaused by: java.sql.BatchUpdateException: ORA-00001: 违反唯一约束条件 (JMJL.MAP_T_RELAY_STATION_KEY)rnrn at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:459)rn at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:3907)rn at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:294)rn at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)rn at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)rn ... 62 morern[/code]

ERROR - ORA-00001: 违反唯一约束条件

06-03

我使用oracle的imp/exp工具将test数据库重新备份,并还原为TestZsl数据库。rn在原有写好的程序基础之上,只是将连接数据库的连接字符串改了一下。rnrn后台报错:rnWARN - SQL Error: 1, SQLState: 23000rnERROR - ORA-00001: 违反唯一约束条件 (ZHANGSHENGLIN.SYS_C0011198)rnrnWARN - SQL Error: 1, SQLState: 23000rnERROR - ORA-00001: 违反唯一约束条件 (ZHANGSHENGLIN.SYS_C0011198)rnrnERROR - Could not synchronize database state with sessionrnorg.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch updatern at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)rn at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)rn at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)rn at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)rn at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)rn at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)rn at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)rn at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)rn at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366)rn at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)rn at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655)rn at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)rn at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)rn at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)rn at $Proxy34.adminValidateLogin(Unknown Source)rn at com.action.UserAction.adminLogin(UserAction.java:985)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:89)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)rn at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn rnCaused by: java.sql.BatchUpdateException: ORA-00001: 违反唯一约束条件 (ZHANGSHENGLIN.SYS_C0011198)rnrn at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343)rn at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10768)rn at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)rn at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)rn at rnrnrnrnrnrnrnrnorg.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)rn ... 92 morernrnrn检查数据库发现,导入后的日志表比原数据库中的日志表少了几十条数据。再查看约束条件ZHANGSHENGLIN.SYS_C0011198,发现它跟原来数据库的约束条件一模一样。rnrnrn我就有疑问了,为什么我用导入导出工具导入的数据会少了原表中的最后面的几十条?rn还有就是怎么会报这个“ERROR - ORA-00001: 违反唯一约束条件 (ZHANGSHENGLIN.SYS_C0011198)”错误呢?rnrn

ERROR [org.hibernate.util.JDBCExceptionReporter] ORA-00001: 违反唯一约束条件

04-20

程序代码如下:rn[code=java] public void saveTdSeoProduct(TdSeoProduct tdSeoProduct)rn TdSeoProduct po=(TdSeoProduct)session.get(TdSeoProduct.class, tdSeoProduct.getProductid());rn if(po!=null)rn po.setSourceWord(tdSeoProduct.getSourceWord());rn po.setCreateddate(tdSeoProduct.getCreateddate());rn po.setSeoWord(tdSeoProduct.getSeoWord());rn try rn session.update(po);rn catch (HibernateException e) rn log.error("session.update(po) error productid=" + po.getProductid(), e);rn rn elsern try rn session.save(tdSeoProduct);rn catch (HibernateException e) rn log.error("session.save(tdSeoProduct) error productid=" + tdSeoProduct.getProductid(), e);rn rn rn rn [/code]rn报错信息如下:rn[code=java]rn2014-04-17 17:30:36,123 ERROR [org.hibernate.util.JDBCExceptionReporter] ORA-00001: 违反唯一约束条件 (HGGJV2.PK_PRODUCT_ID)rn2014-04-17 17:30:36,123 ERROR [org.hibernate.event.def.AbstractFlushingEventListener] Could not synchronize database state with sessionrnorg.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch updatern at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)rn at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)rn at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)rn at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:237)rn at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)rn at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)rn at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)rn at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)rn at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)rn at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59)rn at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:114)rn at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:247)rn at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86)rn at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)rn at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1389)rn at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)rn at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)rn at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)rn at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)rn at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)rn at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)rn at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)rn at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)rn at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)rn at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)rn at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)rn at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)rn at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)rn at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)rn at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)rn at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)rn at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)rn at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)rn at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)rn at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)rn at $Proxy688.callSearchApi(Unknown Source)rn at com.dhgate.common.client.fenci.FenciServiceDelegate.autoSeoFenci(FenciServiceDelegate.java:120)rn at org.apache.jsp.calljob_jsp._jspService(calljob_jsp.java:1717)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)rn at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)rn at java.lang.Thread.run(Thread.java:662)[/code]rn哪位大神帮解决下,很奇怪,我在程序中会首先根据主键判断数据库中是否存在该实例,存在则update,不存在则save,按理说不应该报这个错误,百思不得其解啊,寻求帮助。。。。。

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试