We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
代码 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关键字,现在这种场合下,并发时,是否会有问题。
The text was updated successfully, but these errors were encountered:
会有线程安全问题。已修改。 但我们也建议不要在生产环境使用MemoryTransactionLogStorage,MemoryTransactionLogStorage仅应作为本地demo使用。
Sorry, something went wrong.
4695545
No branches or pull requests
代码
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关键字,现在这种场合下,并发时,是否会有问题。
The text was updated successfully, but these errors were encountered: