RIA 中的并发
这是我在这个平台上的第一个问题。 我使用 Flex、WebORB 和 ASP.NET 进行了大量开发。 我们已经解决了消息传递的并发问题(悲观并发控制)。 这工作得很好,但它也使整个应用程序依赖于消息传递。 没有消息传递,没有并发控制。 我知道 ASP.NET 在数据集中有版本控制,但是如果您正在开发 RIA,您将如何使用它。 似乎很难将每个数据集存储在客户端的会话中......因此,如果客户端需要所有产品,我需要将数据集存储在客户端的会话中。 当客户对产品进行更改并保存产品时,我可以更新数据集(存储在会话中)并尝试保存它...... 似乎需要大量工作和大量内存(因为这些产品将保存在客户端的内存中,因此数据集需要保存在服务器端会话中)。 我认为最简单的方法是为所有 DTO 提供版本号。 如果客户端尝试保存 DTO,我可以将版本号与数据库中的版本号进行比较。
列文·卡登
This'll be my first question on this platform. I've done lots of development using Flex, WebORB and ASP.NET. We have solved Concurrency problems with messaging (Pessimistic Concurrency Control). This works pretty good but it also makes the whole application dependent of the messaging. No messaging, no concurrency control.
I know that ASP.NET has version control in DataSets, but how would you go and use that if you are working on a RIA. It seems hard to go and store each dataset in the session of the client... So, if the Client would like need all products, I would need to store the dataset in the session of the client. When the client would change something to a product and save the product, I could then update the dataset (stored in the session) and try to save it...
Seems a lot of work and a lot of memory that will be used (because those products will be kept in the memory of the client, so the dataset needs to be kept on the server side session).
I think the most easy way would be to provide all DTO's with a version number. If the client would try to save a DTO, I could compare the version number with the one in the database.
Lieven Cardoen
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我之前做过的事情 - 由于原始数据来自 SQL Server 数据库,我们只是在每个 DTO 中使用 rowversion 类型列来确定它在用户处理它时是否已更改。
此时,您可以对错误进行吐槽,也可以尝试找出合并更改的方法,但至少您可以知道它在您的下面发生了更改:)
This is something I've done before - as the original data was coming from an SQL Server database we just used a rowversion typed column in each DTO to determine if it had changed while the user was working on it.
At this point you can either barf on the error or try and figure out a way to merge the changes, but at least you can tell that it's changed underneath you :)