分布式应用程序并发. [英] Distributed Applications Concurrency.

查看:141
本文介绍了分布式应用程序并发.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个客户端,它们对相同的数据进行操作,如下所示. (图1).

我删除了,并对其进行"

>

现在,当我"更新" Client-2,理论上应将"2- Sanju-24" 添加到

以某种方式,所需的功能().但是,使这种情况发生的原因尚不清楚.

有人可以澄清吗?

解决方案


您需要在DAC和数据库中实现
system.data.sqlclient.sqltransaction
.


C#
----
http ://msdn.microsoft.com/zh-CN/library/system.data.sqlclient.sqltransaction.aspx

http://msdn.microsoft.com/en-us/library/c5kehkcz.aspx

Sql Server
-----------
http://msdn.microsoft.com/zh-cn/library/ms174377.aspx

在删除或更新分布式环境中的数据之前
1.您需要确保数据在数据库中是否可用.
2.您需要使用 OptimisticLock.

查看此链接

http://msdn.microsoft.com/zh-CN/library/aa0416cz(VS.71).aspx


I have two clients operating on the same data as shown below. (Fig.1).

 

 

 

Fig.1.

 

I delete "2- Sanju-24" from the list in Client-1 and "Update" it which updates the local dataset AND the database using "SQLCommandBuilder". (see fig.2)

 

Fig.2.

 

Now, when I "Update" Client-2, theoretically, "2- Sanju-24" should be added to the Database. But it is not happening. 

 

Somehow, the desired functionality ("2- Sanju-24" getting deleted automatically) is happening. But what makes this happen is Not understood.

 

 

 

 

Could anybody clarify on this?

解决方案

Hi,
You need to implement the
system.data.sqlclient.sqltransaction
in your DAC as well as you database also.


C#
----
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqltransaction.aspx

http://msdn.microsoft.com/en-us/library/c5kehkcz.aspx

Sql Server
-----------
http://msdn.microsoft.com/en-us/library/ms174377.aspx

before delete or update the data in the distributed env
    1.you need to ensure the data is available or not in the db.
    2.you need to use the OptimisticLock .

have a look at this link

http://msdn.microsoft.com/en-us/library/aa0416cz(VS.71).aspx


这篇关于分布式应用程序并发.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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