卷筒纸插入在同一时间 [英] web inserts at the same time

查看:131
本文介绍了卷筒纸插入在同一时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经开发了一个在线测验,用户可以注册一个团队参加测验。

We have developed an online quiz where users can register a team to take part in the quiz.

有是在ASP检查,看看是否能teamname已经提交,如果有,会产生一个错误。

There is a check in the asp to see if that teamname has already been submitted, and if it has, an error is generated.

我们也注意到这样一个问题,如果2队恰好在同一时间使用相同的名称注册了,两队都注册。虽然这是极不可能的,我们不知道应该用来解决这个什么办法。

We have noticed a problem if 2 teams are registered at exactly the same time with the same name, that both teams are registered. Although this is highly unlikely, we wondered what approach should be used to overcome this.

我们正在使用MySQL作为数据库,如果有什么差别。

We are using mySql as the database if that makes any difference.

感谢您的任何指导。

推荐答案

您可以设置名称列是唯一的,并且数据库将抛出的第二个插入一个错误。如果你想这样做在code,它会更加复杂。

You can set the name column to be unique, and the database will throw an error on the second insert. If you want to do it in code, it will be more complicated.

这篇关于卷筒纸插入在同一时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆