static final EventBus EVENTBUS = new AsyncEventBus(new ThreadPoolExecutor(1, 10,
60L, TimeUnit.SECONDS,
new SynchronousQueue()));
2021-07-14 10:33:37.984 INFO 21384 --- [nio-8085-exec-2] c.i.dmp.api.daam.ResInfolibListener : publish resInfo string
2021-07-14 10:33:37.986 INFO 21384 --- [pool-6-thread-6] c.i.dmp.api.daam.ResInfolibListener : process event {"createTime":1626230017986,"id":"5b7f5f1f-5499-4f1b-96ce-de6d31b2124f","reportTime":1620271380000,"resId":"string"}
Hibernate: select daamresinf0_.ID as ID1_27_0_, daamresinf0_.CREATETIME as CREATETI2_27_0_, daamresinf0_.REPORTTIME as REPORTTI3_27_0_, daamresinf0_.RESID as RESID4_27_0_ from DAAM_RESINFOLOG daamresinf0_ where daamresinf0_.ID=?
Hibernate: insert into DAAM_RESINFOLOG (CREATETIME, REPORTTIME, RESID, ID) values (?, ?, ?, ?)
2021-07-14 10:33:38.113 INFO 21384 --- [pool-6-thread-8] c.i.dmp.api.daam.ResInfolibListener : process event {"createTime":1626230017986,"id":"5b7f5f1f-5499-4f1b-96ce-de6d31b2124f","reportTime":1620271380000,"resId":"string"}
2021-07-14 10:33:38.113 INFO 21384 --- [ool-6-thread-10] c.i.dmp.api.daam.ResInfolibListener : process event {"createTime":1626230017986,"id":"5b7f5f1f-5499-4f1b-96ce-de6d31b2124f","reportTime":1620271380000,"resId":"string"}
Hibernate: select daamresinf0_.ID as ID1_27_0_, daamresinf0_.CREATETIME as CREATETI2_27_0_, daamresinf0_.REPORTTIME as REPORTTI3_27_0_, daamresinf0_.RESID as RESID4_27_0_ from DAAM_RESINFOLOG daamresinf0_ where daamresinf0_.ID=?
Hibernate: select daamresinf0_.ID as ID1_27_0_, daamresinf0_.CREATETIME as CREATETI2_27_0_, daamresinf0_.REPORTTIME as REPORTTI3_27_0_, daamresinf0_.RESID as RESID4_27_0_ from DAAM_RESINFOLOG daamresinf0_ where daamresinf0_.ID=?
2021-07-14 10:33:38.248 INFO 21384 --- [pool-6-thread-9] c.i.dmp.api.daam.ResInfolibListener : process event {"createTime":1626230017986,"id":"5b7f5f1f-5499-4f1b-96ce-de6d31b2124f","reportTime":1620271380000,"resId":"string"}
Hibernate: select daamresinf0_.ID as ID1_27_0_, daamresinf0_.CREATETIME as CREATETI2_27_0_, daamresinf0_.REPORTTIME as REPORTTI3_27_0_, daamresinf0_.RESID as RESID4_27_0_ from DAAM_RESINFOLOG daamresinf0_ where daamresinf0_.ID=?
ERROR SqlExceptionHelper 违反了 PRIMARY KEY 约束“PK__DAAM_RES__3214EC279A824D19”。不能在对象“dbo.DAAM_RESINFOLOG”中插入重复键。重复键值为 (d1d5c50e-ce65-48b4-9289-67efa0c6d599)。
ERROR ExceptionMapperStandardImpl HHH000346: Error during managed flush [org.hibernate.exception.ConstraintViolationException: could not execute statement]
ERROR SqlExceptionHelper 违反了 PRIMARY KEY 约束“PK__DAAM_RES__3214EC279A824D19”。不能在对象“dbo.DAAM_RESINFOLOG”中插入重复键。重复键值为 (d1d5c50e-ce65-48b4-9289-67efa0c6d599)。
ERROR ExceptionMapperStandardImpl HHH000346: Error during managed flush [org.hibernate.exception.ConstraintViolationException: could not execute statement]
查看日志,是分发给了多个线程。取消异步化:
static final EventBus EVENTBUS = new EventBus();
2021-07-14 11:01:11.282 INFO 34248 --- [nio-8085-exec-9] c.i.dmp.api.daam.ResInfolibListener : publish resInfo string
2021-07-14 11:01:11.434 INFO 34248 --- [nio-8085-exec-9] c.i.dmp.api.daam.ResInfolibListener : process event {"createTime":1626231671412,"id":"873678fe-795b-4360-b174-c98d76de4738","reportTime":1620271380000,"resId":"string"}
Hibernate: select daamresinf0_.ID as ID1_27_0_, daamresinf0_.CREATETIME as CREATETI2_27_0_, daamresinf0_.REPORTTIME as REPORTTI3_27_0_, daamresinf0_.RESID as RESID4_27_0_ from DAAM_RESINFOLOG daamresinf0_ where daamresinf0_.ID=?
Hibernate: insert into DAAM_RESINFOLOG (CREATETIME, REPORTTIME, RESID, ID) values (?, ?, ?, ?)