序列化 EMF 模型实例的最佳方法是什么?

发布于 2024-07-25 18:40:29 字数 198 浏览 5 评论 0原文

我有一个 Eclipse RCP 应用程序,其中有一个内存中填充的 EMF 模型实例。 存储该模型以供外部系统访问的最佳方式是什么? 访问可能发生在运行时期间和之后。

该模型的读取和写入非常平衡,并且每秒可能发生多次。

我认为使用 Hibernate + Teneo + EMF 填充的数据库会很好地工作,但我想知道还有哪些其他选项。

I have an Eclipse RCP application with an instance of an EMF model populated in memory. What is the best way to store that model for external systems to access? Access may occur during and after run time.

Reads and writes of the model are pretty balanced and can occur several times a second.

I think a database populated using Hibernate + Teneo + EMF would work nicely, but I want to know what other options are out there.

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

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

发布评论

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

评论(2

空城之時有危險 2024-08-01 18:40:29

我将 CDO(连接数据对象)与 EMF 结合使用来执行类似的操作。 如果您使用 Eclipse wiki 中的示例,则不需要太长时间即可运行它。 一些注意事项:

  1. 对于经常更改的数据,您可能需要使用非审核模式来实现持久性。 否则,您将在每次提交时保存 EObject 的新版本,同时保留旧版本。

  2. 您可以选择在每次数据更改时提交,也可以选择以较低的频率提交,具体取决于您需要发布更新的频率。

  3. 如果您选择这样做,您还拥有相当灵活的锁定选项。

我的应用程序使用 Derby 进行持久化,尽管不久它就会迁移到 SQL Server。

Eclipse Live 上有一个 1 小时的网络研讨会 (http://live.eclipse.org/node/635)介绍了 CDO 并给出了一些很好的用法示例。

I'm using CDO (Connected Data Objects) in conjunction with EMF to do something similar. If you use the examples in the Eclipse wiki, it doesn't take too long to get it running. A couple of caveats:

  1. For data that changes often, you probably will want to use nonAudit mode for your persistence. Otherwise, you'll save a new version of your EObject with every commit, retaining the old ones as well.

  2. You can choose to commit every time your data changes, or you can choose to commit at less frequent intervals, depending on how frequently you need to publish your updates.

  3. You also have fairly flexible locking options if you choose to do so.

My application uses Derby for persistence, though it will be migrated to SQL Server before long.

There's a 1 hour webinar on Eclipse Live (http://live.eclipse.org/node/635) that introduces CDO and gives some good examples of its usage.

迷雾森÷林ヴ 2024-08-01 18:40:29

我会选择 Teneo 来完成繁重的工作,除非性能是一个真正的问题(除非你的模型很大,否则不会是这样)。 即使速度很慢,您也可以使用 JPA 注释来调整它。

I'd go with Teneo to do the heavy lifting unless performance is a real problem (which it won't be unless your models are vast). Even if it is slow you can tune it using JPA annotations.

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