You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2019/09/04 11:33:31 UTC
[GitHub] [servicecomb-pack] liulzz opened a new issue #552:
TCC:java.sql.SQLIntegrityConstraintViolationException:Duplicate entry key
liulzz opened a new issue #552: TCC:java.sql.SQLIntegrityConstraintViolationException:Duplicate entry key
URL: https://github.com/apache/servicecomb-pack/issues/552
GlobalTxEventRepository:line 37
```
@Query(value = "SELECT t FROM GlobalTxEvent AS t WHERE t.creationTime < ?1 and t.txType = ?2 order by t.creationTime asc")
Optional<List<GlobalTxEvent>> findTimeoutGlobalTx(Date deadLine, String txType, Pageable pageable);
```
是不是应该排除掉已有的END_TIMEOUT, like
```
@Query(value = "SELECT t FROM GlobalTxEvent AS t WHERE t.creationTime < ?1 and t.txType = ?2 "
+ "AND NOT EXISTS(select 1 from GlobalTxEvent b where b.txType='END_TIMEOUT' AND b.globalTxId=t.globalTxId) order by t.creationTime asc")
Optional<List<GlobalTxEvent>> findTimeoutGlobalTx(Date deadLine, String txType, Pageable pageable);
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services