Skip to content

Commit

Permalink
Merge pull request #122 from LucaLq/main
Browse files Browse the repository at this point in the history
feat[orm]:output stack information when concurrent writeh
  • Loading branch information
jaysunxiao authored Jul 9, 2024
2 parents 2b7b8b5 + ea7d1cf commit 4d01f39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions orm/src/main/java/com/zfoo/orm/cache/EntityCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ private PNode<PK, E> fetchCachePnode(E entity, boolean safe) {
var pnodeThread = ThreadUtils.findThread(pnodeThreadId);
// 有并发写风险,第一次更新文档的线程和第2次更新更新文档的线程不相等
if (pnodeThread == null) {
logger.warn("[{}][id:{}] concurrent write warning, first update [threadId:{}], second update [threadId:{}]", entity.getClass().getSimpleName(), entity.id(), pnodeThreadId, currentThreadId);
logger.warn("orm concurrent write warning", new RunException("[{}][id:{}] first update [threadId:{}], second update [threadId:{}]", entity.getClass().getSimpleName(), entity.id(), pnodeThreadId, currentThreadId));
} else {
logger.warn("[{}][id:{}] concurrent write warning, first update [threadId:{}][threadName:{}], second update [threadId:{}][threadName:{}]"
, entity.getClass().getSimpleName(), entity.id(), pnodeThreadId, pnodeThread.getName(), currentThreadId, Thread.currentThread().getName());
logger.warn("orm concurrent write warning", new RunException("[{}][id:{}] first update [threadId:{}][threadName:{}], second update [threadId:{}][threadName:{}]"
, entity.getClass().getSimpleName(), entity.id(), pnodeThreadId, pnodeThread.getName(), currentThreadId, Thread.currentThread().getName()));
}
}
}
Expand Down

0 comments on commit 4d01f39

Please sign in to comment.