Transactions


#1

I just realized Cayley supports transactions - https://github.com/cayleygraph/cayley/blob/master/graph/transaction_test.go

Is this only available when Cayley is used as Library? Also, I remember I was asked about transaction support during a recent talk so I wonder if it’s better to mentioned it on the readme.


#2

@oren interestingly, I thought (read: assumed) the transactions were dependent on backends, but @dennwc informed me they actually happen on the Cayley side currently – would be interesting to get a discussion around improving that / using native transactions of like bolt.


#3

Sorry, maybe I was not precise in formulation. Bolt and Postgres both take care of individual transactions.

The context of my statement was that Postgres import could be done as single transaction and it may be more efficient. But for now there is no way for backend to change the import process, thus Postgres and Bolt are forced to apply large amount of transactions on import.


#4

My bad, I just gotta go read the code, I don’t at the moment understand how transactions work.


#5

Late to the conversation here, but I want to add that the reason I’m not enthusiastic about using Cayley is that transaction support is limited to write-only operations. I think it’s possible to write a backend integration that would support reading and writing within a transaction with whatever transactional guarantees that backend supports. Using it would be a little more involved though, as (leaving the Cayley interfaces as they are) it would mean creating a new “connection” per transaction. I know that’s not a very clear explanation. If I take another shot at making it happen, I’ll at least share a gist or something to show the idea.