ref[module]: 多线程访问时只记录下线程id

This commit is contained in:
jianan
2022-07-25 15:38:53 +08:00
parent b295d24863
commit dc9c558e30
2 changed files with 2 additions and 11 deletions
@@ -144,8 +144,8 @@ public class EntityCaches<PK extends Comparable<PK>, E extends IEntity<PK>> impl
}
if (currentPnode.getThreadId() != Thread.currentThread().getId()) {
logger.error("[{}]被多线程访问了,先后2次访问线程分别是[{}] [{}]", entity.getClass().getSimpleName(),
currentPnode.getThreadName(), Thread.currentThread().getName());
logger.error("[{}]被多线程访问了,先后2次访问线程ID分别是[{}] [{}]", entity.getClass().getSimpleName(),
currentPnode.getThreadId(), Thread.currentThread().getId());
}
// 加100以防止,立刻加载并且立刻修改数据的情况发生时,服务器取到的时间戳相同
@@ -35,7 +35,6 @@ public class PNode<E extends IEntity<?>> {
// 记录最初访问时的线程信息
private long threadId;
private String threadName;
public PNode(E entity) {
this.entity = entity;
@@ -45,7 +44,6 @@ public class PNode<E extends IEntity<?>> {
this.modifiedTime = currentTime;
this.threadId = Thread.currentThread().getId();
this.threadName = Thread.currentThread().getName();
}
public E getEntity() {
@@ -80,11 +78,4 @@ public class PNode<E extends IEntity<?>> {
this.threadId = threadId;
}
public String getThreadName() {
return threadName;
}
public void setThreadName(String threadName) {
this.threadName = threadName;
}
}