客户端仍然连接时如何更新DataSnap服务器? [英] How can I update a DataSnap server while clients are still connected?

查看:262
本文介绍了客户端仍然连接时如何更新DataSnap服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用状态DataSnap服务器进行一些业务逻辑任务,并提供客户端数据。

We use stateful DataSnap servers for some business logic tasks and also to provide clientdataset data.

如果我们必须更新服务器来修改业务规则,我们将复制新版本进入新的空文件夹并注册(取决于Delphi版本,只需启动或运行TRegSvr实用程序)。

If we have to update the server to modify a business rule, we copy the new version into a new empty folder and register it (depending on the Delphi version, just by launching or by running the TRegSvr utility).

即使在旧服务器实例正在运行。但是,注册新版本后,,所有新的客户端连接仍将使用当前正在运行的(旧)服务器实例。所有客户端都必须首先断开连接,然后新的服务器将被用于下一个客户端。

We can do this even while the old server instance is running. However, after registering the new version, all new client connections will still use the currently running (old) server instance. All clients have to disconnect first, then the new server will be used for the next clients.

有没有办法将所有新的客户端连接到新的服务器,注册后立即?

Is there a way to direct all new client connections to the new server, immediately after registering?

(我知道新的或更改的方法签名也需要更改和重新启动客户端,但这个问题是关于内部不影响接口的修改)

(I know that new or changed method signatures will also require a change and restart of the clients but this question is about internal modifications which do not affect the interface)

我们正在使用Socket连接,所有客户端共享相同的服务器应用程序(只有一个应用程序窗口打开)。在早期,我们使用了远程数据模块的不同配置,每个客户端产生一个应用程序窗口。也许这可能是一个解决方案? (因为每个新客户端都将启动当前注册的可执行文件)

We are using Socket connections, and all clients share the same server application (only one application window is open). In the early days we have used a different configuration of the remote datamodule which resulted in one app window per client. Maybe this could be a solution? (because every new client will launch the currently registered executable)

更新:Delphi XE是否为热部署(更新的服务器)提供了一些支持?我们现在使用Delphi 2009,但是如果它更容易实现热部署,则升级到XE。

Update: does Delphi XE offer some support for 'hot deployment' (of updated servers)? We use Delphi 2009 at the moment but would upgrade to XE if it offers easier implementation of 'hot deployment'.

推荐答案

你可以将您的应用服务器分成两个新服务器,一个是一个简单的代理对象,将所有方法重定向(并且可选地包含状态信息(如果有的话))到实际实现业务逻辑的第二个。您还需要在代理服务器中实施静默重新连接功能,以便在您随时想要替换业务应用服务器时,不要打扰连接的客户端。从来没有做过这样的设计,但希望这个想法是明确的

you could separate your appserver into 2 new servers, one being a simple proxy object redirecting all methods (and optionally containing state info if any) to the second one actually implementing your business logic. you also need to implement "silent reconnect" feature within your proxy server in order not to disturb connected clients if you decide to replace business appserver any time you want. never did such design myself before but hope the idea is clear

这篇关于客户端仍然连接时如何更新DataSnap服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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