wyzssw opened a new issue #216: Duplicated when save TxTimeoutEvent
URL: https://github.com/apache/incubator-servicecomb-saga/issues/216
 
 
   Alpha-Server Print Error Log
   when execute code
   ```java
   private void findTimeoutEvents() {
       eventRepository.findTimeoutEvents()
           .forEach(event -> {
             LOG.info("Found timeout event {}", event);
             timeoutRepository.save(txTimeoutOf(event));
           });
     }
   ```
    
   ```java
   2018-07-11 18:08:28.406  INFO 3700 --- [pool-2-thread-1] 
o.a.s.saga.alpha.core.EventScanner       : Found timeout event 
TxEvent{surrogateId=20, serviceName='booking', instanceId='booking-127.0.0.1', 
creationTime=Wed Jul 11 17:31:29 CST 2018, 
globalTxId='94fc1a1f-8dff-41bd-bb7b-82984456ed1c', 
localTxId='94fc1a1f-8dff-41bd-bb7b-82984456ed1c', parentTxId='null', 
type='SagaStartedEvent', compensationMethod='', expiryTime=Thu Jul 12 10:11:29 
CST 2018, retryMethod='', retries=0}
   [EL Warning]: 2018-07-11 18:08:31.446--UnitOfWork(1680426037)--Exception 
[EclipseLink-4002] (Eclipse Persistence Services - 2.7.1.v20171221-bd47e8f): 
org.eclipse.persistence.exceptions.DatabaseException
   Internal Exception: 
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: 
Duplicate entry '20' for key 'eventId'
   Error Code: 1062
   Call: INSERT INTO TxTimeout (EVENTID, EXPIRYTIME, GLOBALTXID, INSTANCEID, 
LOCALTXID, PARENTTXID, SERVICENAME, STATUS, TYPE, VERSION) VALUES (?, ?, ?, ?, 
?, ?, ?, ?, ?, ?)
        bind => [10 parameters bound]
   Query: InsertObjectQuery(TxTimeout{eventId=20, serviceName='booking', 
instanceId='booking-127.0.0.1', 
globalTxId='94fc1a1f-8dff-41bd-bb7b-82984456ed1c', 
localTxId='94fc1a1f-8dff-41bd-bb7b-82984456ed1c', parentTxId='null', 
type='SagaStartedEvent', expiryTime=Thu Jul 12 10:11:29 CST 2018, status=NEW})
   2018-07-11 18:08:31.452  WARN 3700 --- [pool-2-thread-1] 
o.a.s.s.a.s.SpringTxTimeoutRepository    : Failed to save some timeout 
TxTimeout{eventId=20, serviceName='booking', instanceId='booking-127.0.0.1', 
globalTxId='94fc1a1f-8dff-41bd-bb7b-82984456ed1c', 
localTxId='94fc1a1f-8dff-41bd-bb7b-82984456ed1c', parentTxId='null', 
type='SagaStartedEvent', expiryTime=Thu Jul 12 10:11:29 CST 2018, status=NEW}
   
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to