mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-09-04 04:18:21 +00:00
ref[module]: 多线程访问时只记录下线程id
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user