赞
踩
MySQL 版本:5.7.9
表结构:
CREATE TABLE `award` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`award` varchar(255) DEFAULT NULL,
`count` int(11) NOT NULL COMMENT '数量',
`created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8
原理可参看:CountDownLatch 模拟高并发
package com.wlm.test.concurrent;
import java.util.concurrent.CountDownLatch;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wlm.test.award.AwardDao;
/**
* @author wengliemiao
*/
@Service
public class ConcurrentTest {
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。