Skip to content

MemoryTransactionLogStorage重试次数更新并发问题 #75

Closed
@jiang2015

Description

代码
com.dangdang.ddframe.rdb.transaction.soft.storage.impl.MemoryTransactionLogStorage

方法中:
@OverRide
public void increaseAsyncDeliveryTryTimes(final String id) {
if (DATA.containsKey(id)) {
TransactionLog transactionLog = DATA.get(id);
transactionLog.setAsyncDeliveryTryTimes(transactionLog.getAsyncDeliveryTryTimes() + 1);
DATA.put(id, transactionLog);
}
}

getAsyncDeliveryTryTimes是否应该在TransactionLog 的asyncDeliveryTryTimes 加个volatile关键字,现在这种场合下,并发时,是否会有问题。

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions