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 ·

How do I implement transaction handling now that it's deprecated in DSE 6.8?

[FOLLOW QUESTION TO #4820]

I am trying to have two transactions and commit them. But if one of those two fails I don't want either of them to be executed basically I want to rollback it. And if it succeeds in committing both the transactions then close it.

try
{ 
 Transaction t1 ~ udpating an edge property
 Transaction t2 ~ updating a vertex related to the edge in t1.(i.e. t2 is dependednt on t1)
  t1.commit()
  t2.commit()
} 
          
catch() 
{ 
  rollback() //if one of the two transactions fails
} 
          
finally
{ 
   close() // close if successful in commiting both the transactions
} 

How can I do something like this in the DSE 6.8 graph?

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.

1 Answer

bryn.cooke_101029 avatar image
bryn.cooke_101029 answered ·

Mutations in 6.8 graphs are committed when a traversal is iterated out.

So you can get the same effect that you had before as long as you can combine your mutations in to one traversal.

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.