FISCO-BCOS/fisco-bcos-browser

在重启浏览器Tomcat服务以后,报主键冲突的错误,再也不能愉快的使用了

liubenlong opened this issue · 1 comments

Caused by: org.springframework.dao.DuplicateKeyException:

Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '0x14182e0d8082c05bfbbb196eae807c2e01ee6f96efeed8021c6640e6d51954' for key 'PRIMARY'

The error may involve cn.bcos.browser.dao.GovernServiceDAO.insertTransactionInfo-Inline

The error occurred while setting parameters

SQL: insert into tb_transaction( pk_hash, blockHash, blockNumber, blockTimestamp, blockGasLimit, transactionIndex, transactionFrom, transactionTo, gas, gasPrice, cumulativeGas, randomId, contractName, version, method, params, inputText, gmt_create, gmt_modify ) values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW(), NOW() )

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '0x14182e0d8082c05bfbbb196eae807c2e01ee6f96efeed8021c6640e6d51954' for key 'PRIMARY'

; SQL []; Duplicate entry '0x14182e0d8082c05bfbbb196eae807c2e01ee6f96efeed8021c6640e6d51954' for key 'PRIMARY'; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '0x14182e0d8082c05bfbbb196eae807c2e01ee6f96efeed8021c6640e6d51954' for key 'PRIMARY'
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239) ~[spring-jdbc-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) ~[spring-jdbc-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73) ~[mybatis-spring-1.2.2.jar:1.2.2]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371) ~[mybatis-spring-1.2.2.jar:1.2.2]
at com.sun.proxy.$Proxy30.insert(Unknown Source) ~[?:?]
at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:240) ~[mybatis-spring-1.2.2.jar:1.2.2]
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:51) ~[mybatis-3.2.8.jar:3.2.8]
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52) ~[mybatis-3.2.8.jar:3.2.8]
at com.sun.proxy.$Proxy34.insertTransactionInfo(Unknown Source) ~[?:?]
at sun.reflect.GeneratedMethodAccessor207.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) ~[spring-aop-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) ~[spring-aop-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) ~[spring-tx-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) ~[spring-aop-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at com.sun.proxy.$Proxy35.insertTransactionInfo(Unknown Source) ~[?:?]
at cn.bcos.browser.service.GovernService.handleTransInfo(GovernService.java:231) ~[classes/:?]
at cn.bcos.browser.service.GovernService.handleBlockInfo(GovernService.java:153) ~[classes/:?]
at cn.bcos.browser.service.GovernService.handleBlockInfo(GovernService.java:129) ~[classes/:?]
at sun.reflect.GeneratedMethodAccessor204.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:269) ~[spring-core-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:257) ~[spring-context-support-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75) ~[spring-context-support-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.quartz.core.JobRunShell.run(JobRunShell.java:202) ~[quartz-2.3.0.jar:?]

谢谢建议,之后会改进修复