使用Web应用程序更新多个表中的记录 [英] Updating records in multiple tables using web application

查看:87
本文介绍了使用Web应用程序更新多个表中的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有疑问.

在我的应用程序(Web应用程序)中,当用户单击保存按钮时,我需要更新5个表中的记录,在此过程中,其他用户不应允许更新相同5个表中的记录.

一旦第一个用户完成了该过程,下一个用户就可以继续

我的问题是需要实现多线程吗?

I have a doubt.

In my application (web application), when user click on the save button I need to update records in 5 table , during this process other users should not allow to update records in the same 5 tables.

Once the first user completed the process next user can proceed

my question is it require to implement multi threading?

推荐答案

您应该在数据库中使用Transaction或Lock.
可以研究有关这些链接的
交易锁定.

最好的问候,
Theingi Win
You should use Transaction or Lock in your database.
Can study these links about
Transaction and Lock.

Best Regard,
Theingi Win


您确定其他人无法修改相同的表或相同的行吗?

通常,此要求是在行级别定义的,dbms会注意这一点,dbms使用锁来防止在同一行上同时进行修改.

因此,正如Theingi Win已经指出的那样,作为一名程序员,您有责任将所有必要的DML(插入,更新...)操作包装到一个事务中.
Are you sure that other people cannot modify the same tables or the same rows?

Typically this requirement is defined on row level and this is taken care by the dbms which uses locks to prevent simultaneous modifications on the same rows.

So as Theingi Win already pointed out, as a programmer you''re responsible in wrapping all the necessary DML (insert, update...) operations into a single transaction.


我的问题需要实现多线程吗?"

编号
请详细描述我"

不,不需要执行多线程操作即可更新5个表中的记录.

足够详细了吗?
"my question is it require to implement multi threading?"

No.
"Please describe me in detail"

No, it is not required to implement multi threading in order to update records in 5 tables.

Is that detailed enough for you?


这篇关于使用Web应用程序更新多个表中的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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