Home > OS >  "Write" Transactions don't work when using C#/Node.js with Amazon Neptune
"Write" Transactions don't work when using C#/Node.js with Amazon Neptune

Time:03-04

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?

CodePudding user response:

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

  • Related