简体   繁体   English

Flex和数据并发

[英]flex and data concurrency

I am soon to embark on a medium scale project. 我即将着手进行一个中等规模的项目。 Although this isn't a very high priority in my large list of things to do but I have been trying of how I could affectively handle data concurrency. 尽管在我要做的事情中,这并不是一个很重要的优先事项,但是我一直在尝试如何有效地处理数据并发。 I will be using a stateless EJB backend to my flex application. 我将在我的flex应用程序中使用无状态EJB后端。

Ideally I am looking for a simple method to deal with data concurrency. 理想情况下,我正在寻找一种处理数据并发的简单方法。 eg if data is saved on one interface it is refreshed in another. 例如,如果数据保存在一个接口上,则在另一个接口上刷新。 Or it warns that the data has been changed before saving a new version of the data. 或者它警告在保存新版本的数据之前数据已更改。

Has anyone any ideas as I am at a loss at the moment. 有任何想法,因为我此刻不知所措。 As I mentioned its not a high priority but I would feel a lot better if I had some mechanism to improve the process. 正如我提到的那样,它不是一个高度优先的事项,但是如果我有某种机制来改善这一过程,我会感觉好很多。

If you are planning on using AMF channels for communication you can use the long polling feature to effectively give your application "push message" type support. 如果您打算使用AMF通道进行通信,则可以使用长轮询功能来有效地为应用程序提供“推送消息”类型的支持。 Both the BlazeDS and/or GraniteDS data services support this capability for exactly the reasons you mentioned. 正是由于您提到的原因,BlazeDS和/或GraniteDS数据服务都支持此功能。

Version control systems store user_id and datetime for every revision. 版本控制系统为每个修订存储user_id和datetime。 You can use same method. 您可以使用相同的方法。 Client app get current datetime for requested data and save it. 客户端应用获取请求数据的当前日期时间并保存。 App send on changed data with saved datetime. 应用程序以保存的日期时间发送更改的数据。 Server checks datetime of last revision and received datetime. 服务器检查上次修订的日期时间和收到的日期时间。 And reply to app accordingly. 并相应地回复应用。

Second method is using broadcast messages from server to clients. 第二种方法是使用从服务器到客户端的广播消息。 But I don't think it's applicable in your case. 但我认为这不适用于您的情况。 This method put into practice in LAN (environment with stable connect) usually. 这种方法通常在局域网(连接稳定的环境)中付诸实践。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM