PLANNED MAINTENANCE

Hello, DataStax Community!

We want to make you aware of a few operational updates which will be carried out on the site. We are working hard to streamline the login process to integrate with other DataStax resources. As such, you will soon be prompted to update your password. Please note that your username will remain the same.

As we work to improve your user experience, please be aware that login to the DataStax Community will be unavailable for a few hours on:

  • Wednesday, July 15 16:00 PDT | 19:00 EDT | 20:00 BRT
  • Thursday, July 16 00:00 BST | 01:00 CEST | 04:30 IST | 07:00 CST | 09:00 AEST

For more info, check out the FAQ page. Thank you for being a valued member of our community.


question

rohansurana2810_190538 avatar image
rohansurana2810_190538 asked ·

Graph transactions tx() returns UnsupportedOperationException in DSE 6.8

I was trying to use the transaction on DSE 6.8. When I tried to open the transaction it gave me the following error.

Code:

DseCluster dseCluster = DseCluster.builder().addContactPoint("127.0.0.1").build();
DseSession dseSession = dseCluster.connect();
GraphTraversalSource g = DseGraph.traversal(dseSession, new GraphOptions().setGraphName("test_graph"));
g.tx().open();

The error:

Exception in thread "main" java.lang.UnsupportedOperationException: Graph does not support transactions

What is the possible fix for this?

dsegraph
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Erick Ramirez avatar image
Erick Ramirez answered ·

Transactions (tx()) API calls previously included in DSE Graph 6.7 and earlier versions (now referred to as "Classic Graph") are no longer supported in the new DataStax Graph in DSE 6.8. By design, tx() API calls will throw UnsupportedOperationException.

For more info, see What's new in DataStax Graph for a list of additions to the new Graph as well as a list of deprecated items. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

smadhavan avatar image
smadhavan answered ·

@rohansurana2810_190538, yes, per the DSE 6.8 Graph deprecation list, tx() graph API calls will throw an unsupported operation exception. We can do something like the below,

GraphTraversalSource gOLTP = DseGraph.traversal(dseSession, new GraphOptions().setGraphName("mygraph"));
GraphTraversalSource gOLAP = DseGraph.traversal(dseSession, new GraphOptions().setGraphName("myothergraph").setGraphSource(ANALYTICS_SOURCE_NAME));

Vertex v = gOLTP.V().has("name", "marko").next();
long count = gOLAP.V().count().next();
Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.