DataStax Academy FAQ

DataStax Academy migrated to a new learning management system (LMS) in July 2020. We are also moving to a new Cassandra Certification process so there are changes to exam bookings, voucher system and issuing of certificates.

Check out the Academy FAQ pages for answers to your questions:


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.