同步操作将从 sanri1993/example 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
-- 使用数据库来创建唯一主键create table test.SEQUENCE_ID(id bigint(20) unsigned not null auto_increment,value char(1) not null default '',primary key (id)) engine= innodb;CREATE TABLE id_generator (id int(10) NOT NULL auto_increment,max_id bigint(20) NOT NULL COMMENT '当前最大id',step int(20) NOT NULL COMMENT '号段的步长',biz_type int(20) NOT NULL COMMENT '业务类型',version int(20) NOT NULL COMMENT '版本号',PRIMARY KEY (`id`)) engine= innodb;-- 初始化号段表insert into id_generator(max_id,step,biz_type,version) values (0,1000,1000,0);-- 取下一个号段-- 查询当前业务的 max_idselect id,max_id,step,biz_type,version from id_generator where biz_type = ? ;-- 乐观锁更新 max_idupdate id_generator set max_id = max_id + step ,version = version + 1 where id = ? and max_id = ? and version = ?
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。