You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
在高并发的情况下会出现,不过这个不会引起什么问题。
在 2016-11-05 11:51:35,"yezhwi" <[email protected]> 写道:
public Exposer exportSeckillUrl(long seckillId) {
// 优化点:缓存优化:超时的基础上维护一致性
//1:访问redis
Seckill seckill = redisDao.getSeckill(seckillId);
if (seckill == null) {
//2:访问数据库
seckill = seckillDao.queryById(seckillId);
if (seckill == null) {
return new Exposer(false, seckillId);
} else {
//3:放入redis
redisDao.putSeckill(seckill);
}
}
这里在并发的时候,是不是会出现多次查询数据库,多次更新redis?
谢谢~
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
这里在并发的时候,是不是会出现多次查询数据库,多次更新redis?
谢谢~
The text was updated successfully, but these errors were encountered: