“写”将 C#/Node.js 与 Amazon Neptune 结合使用时事务不起作用

发布于 2025-01-11 07:37:46 字数 567 浏览 0 评论 0原文

我能够连接到 Neptune 并能够毫无问题地向其中添加一些数据。但是,当我在 https://tinkerpop.apache 尝试代码时.org/docs/current/reference/#gremlin-dotnet-transactions 它似乎不起作用。我收到以下错误:

“收到的数据反序列化为空对象消息。无法对其进行操作。”

我什至跳转到 JS 示例 (https://tinkerpop.apache .org/docs/current/reference/#gremlin-javascript-transactions)并再次尝试。它也不起作用。

我缺少什么?

I am able to connect to Neptune and was able to add some data to it with no issues. However, when I tried the code at https://tinkerpop.apache.org/docs/current/reference/#gremlin-dotnet-transactions it doesn't seem to work. I receive following error:

"Received data deserialized into null object message. Cannot operate on it."

I even jumped to a JS sample (https://tinkerpop.apache.org/docs/current/reference/#gremlin-javascript-transactions) and tried again. It doesn't work either.

What am I missing?

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

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

发布评论

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

评论(1

荆棘i 2025-01-18 07:37:46

截至撰写本文时,Amazon Neptune 仅支持 TinkerPop 版本 3.4.11。您所引用的使用 tx() 的“遍历事务”语义是 Apache TinkerPop 于 2022 年 1 月中旬发布的 3.5.2 版本中的新语义。

通常仅当您需要提交多个查询但拥有所有查询时才需要事务。查询仅限于一次提交,或者如果其中一个查询失败则进行回滚。如果您不需要此操作,则发送到 Neptune 的每个 Gremlin 查询都将表现为单个事务。

如果您确实需要在 3.4.11 中实现类似事务的行为,请参阅以下文档链接,了解如何使用 Gremlin 会话在 Neptune 中执行此操作:https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-sessions.html

如果您不需要事务,那么这里是与 Neptune 交互的示例通过提交个人查询:
(.NET) https://docs. aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-dotnet.html

(JS) https://docs.aws.amazon。 com/neptune/latest/userguide/access-graph-gremlin-node-js.html

At the time of this writing, Amazon Neptune only has support for TinkerPop version 3.4.11. The "traversal transactions" semantics using tx(), that you are referencing, is new as of 3.5.2 that was released by Apache TinkerPop in mid January 2022.

Transactions are typically only required when you need to submit multiple queries but have all of the queries bounded within a single commit, or with rollback if one of the queries were to fail. If you don't need this, then each Gremlin query sent to Neptune behaves as a single transaction.

If you do need transaction-like behavior in 3.4.11, here's a link to the documentation on how to do that in Neptune using Gremlin sessions: https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-sessions.html

If you don't need transactions, then here are examples of interacting with Neptune by submitting individual queries:
(.NET) https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-dotnet.html

(JS) https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-node-js.html

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