Is it possible to implement transactions in Graph Engine?
I like to do multiple updates on different cells and then commit or rollback these changes.
Even with one cell it is difficult. When I use the next code the modification is not written to disk but the memory is changed!
using (Character_Accessor characterAccessor = Global.LocalStorage.UseCharacter(cellId, CellAccessOptions.StrongLogAhead))
{
characterAccessor.Name = "Modified";
throw new Exception("Test exception");
}
My understanding is: Regardless of you throwing this Exception or not: The changes are always only in memory - until you explicitly call
Global.LocalStorage.SaveStorage()
.You could implement your transaction by saving the storage before you start the transaction, then make the changes, and in case you want to rollback, just call
Global.LocalStorage.ResetStorage()
.All this, of course, only if you do not need high-performance throughput and access the database on a single thread.