如果两个或两个以上的人试图同时更新相同的MySQL表,会发生什么情况? [英] What would happen if 2 or more people attempt to update the same MySQL table at the same time?

查看:118
本文介绍了如果两个或两个以上的人试图同时更新相同的MySQL表,会发生什么情况?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果一个应用程序在任何给定时间有成千上万的同时用户,并且在整个存在过程中有2个或更多用户执行操作,导致该应用程序由于恰好同时执行了一个请求而更新数据库表,该怎么办(到十亿分之一秒).

What if an application has thousands of simultaneous users at any given time and throughout the course of it's existence 2 or more users perform an action that causes the app to update a database table due to a request performed at the exact same time (to the nano second).

会发生什么,MySQL是否会简单地将一个放在另一个之上,而更改会反映出最后一个?或者由于某种内部冲突错误,世界将终结吗?

What would happen, would MySQL simply put one over the other and the change will reflect the last or would the world come to an end due to some sort of internal conflict error?

推荐答案

这完全取决于查询的结构方式以及所使用的并发控件.

It completely depends on how the queries have been structured and what concurrency controls you have used.

我建议阅读很好地概述了问题和可能的解决方案.

I suggest reading this for a good overview of the issues and possible solutions.

这篇关于如果两个或两个以上的人试图同时更新相同的MySQL表,会发生什么情况?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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