ado.net 的 Microsoft Sync 框架可以与 Java 一起使用吗?

发布于 2024-07-10 22:01:09 字数 231 浏览 10 评论 0原文

我计划对其中一个应用程序使用以下架构: 客户端:基于 Java 的应用程序,将使用 MySQL 数据库 服务器:将基于 C#,数据库将是 SQL Server

现在可以在 Java 中使用 Microsoft Sync Framework 吗? (可能通过实现一些接口?)。 我希望 Java 客户端的数据同步到服务器,反之亦然。 这可能吗?

如果没有,那么您可以建议其他一些同步框架吗?

I am planning to use the following architecture for one of the applications:
Client: Java based application, which will use a MySQL database
Server: Will be C# based and the database will be SQL Server

Now is it possible to use Microsoft Sync Framework in Java? (Probably by implementing some interfaces?). I want the data from Java client to be synced to the server and vice versa. IS this possible?

If not, then can you suggest some other Sync framework.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

感悟人生的甜 2024-07-17 22:01:09

首先,我不熟悉同步,但快速阅读一下 概述 建议您的客户端需要提供 Web 服务或 RSS 提要,以便同步运行时从 Java 进程获取要同步的数据。

我在您的设计中看到的问题是,通常有多个客户端,但从语义上讲,只有一个后端 - 在本例中为 MySQL 数据库。 我怀疑这会导致同步认为多个客户端运行时存在冲突,但我可能是错的。

无论如何,除此之外,我假设您的目标是保持 MySQL 和 MSSQL 数据库同步? 如果是这种情况,那么为什么不在成为同步参与者的 MySQL 数据库前面运行服务器端进程。 如果您已经在服务器端安装了 .Net,您甚至可以用 C# 编写它,这必然会缓解互操作问题。

如果您将客户端设置为同步参与者,请查看 Jakarta Commons,我认为其中包含将客户端转变为简单的 Web 服务器所需的代码,该服务器需要它充当同步参与者Web 服务或 RSS 提要。

First off, I'm not familiar with Sync, but a quick read of the overview suggests that your client will need to provide either a web service or RSS feed in order for the Sync runtime to obtain the data to be sync'd from the Java process.

The problems I see with your design is that there's typically more than one client but, semantically, a single backend - the MySQL database in this case. I suspect this would lead to Sync thinking there are conflicts when multiple clients are running, but I could be wrong.

Anyway, that aside I assume your goal is to keep the MySQL and MSSQL databases in Sync? If this is the case then why not run a server-side process in front of the MySQL database that becomes the Sync participant. If you've got alread .Net on the server-side you could even write it in C#, which is bound to ease the interop issues.

If you are set on the client being the Sync participant then take a look at Jakarta Commons, which I think has the code you're need to turn you client into a simple web-server that'll be needed for it to act as a web-service or RSS feed.

一指流沙 2024-07-17 22:01:09

您需要在 Java 和 Sync 框架之间找到一些“粘合剂”。 Java 本机接口将为您提供良好的开端。

You will need to find some "glue" between the Java and the Sync framework. The Java Native Interface will get you a good start.

烟酉 2024-07-17 22:01:09

实际上,您可以直接从 SQL Server 使用更改跟踪。

http://msdn.microsoft.com/en-us/库/cc280462(SQL.100).aspx

Actually you can use change tracking direct from SQL server.

http://msdn.microsoft.com/en-us/library/cc280462(SQL.100).aspx

故事和酒 2024-07-17 22:01:09

您可以将 Sync Framework 的“客户端”部分作为单独的 C#.NET 应用程序或服务。 这意味着将同步客户端和 .NET 框架部署到客户端计算机。 您还必须为同步框架构建 MySQL 客户端提供程序(尽管您可能可以从 codeplex 中找到或改编某些内容)。

如果您无法在客户端计算机上安装 .NET,您可能需要考虑利用基于 Java 堆栈构建的同步系统并使用它。 就像这里建议的解决方案之一:开源框架à la Microsoft 同步框架建议?。 至少其中的一些建议可以同时适用于 MSSQL 和 MySQL。

You could have the "client" part of the Sync Framework be a separate C#.NET application or service. This means deploying the sync client and the .NET framework to the client machines. You would also have to build out a MySQL client provider for the Sync Framework (although you can probably find or adapt something from codeplex).

If you can't install .NET on the client machines, you may need to look at utilizing a sync system built on the Java stack and use that. Something like one of the solutions suggested here: Open source framework à la Microsoft Sync Framework suggestions?. At least some of the suggestions there can talk to both MSSQL and MySQL.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文