Hi Julian,
I am one of the ArangoDB developers.
Just a quick idea: in ArangoDB you can write JavaScript code that is executed on the server as one transaction. Your problem sounds as if your problem could very conveniently be solved by deploying such a JavaScript function to the DB server which does exactly what you do, but on the server as one transactional change.
With the Foxx microservice framework you can even expose this functionality as an additional REST HTTP service, extending the API of ArangoDB.
I am happy to provide more details on this, but probably only tomorrow, since it is already quite late today and I am typing this on my mobile phone.
Cheers,
Max
Am 18. November 2015 20:11:22 MEZ, schrieb Julian May <
julia...@gmail.com>:
>Hi guys
>
>I'm fairly new to the Arango-game, and got my basic writing, reading
>and
>traversals going, but now i need to write a transaction that needs to
>use
>state as part of the transaction (or rethink my overall design) and was
>
>hoping to get some input's in this direction.
>
>I'm trying to solve this key scenario:
>
>*Given the availability for "DBL"-rooms is 6 in the period from
>2015-11-19
>to 2015-11-22 *
>*And the availability for "DBL"-rooms is 9 in the period from
>2015-11-22
>to 2015-11-28*
>*When the availability for "DBL"-roms is decreased by 2 for the period
>from
>2015-11-20 to 2015-11-24*
>*Then I end up with the following availability for "DBL"-rooms*
>* | from 2015-11-19 to 2015-11-20 : 6 "DBL"-rooms available | *
>* | from 2015-11-20 to 2015-11-22 : 4 "DBL"-rooms available |*
>* | from 2015-11-22 to 2015-11-24 : 7 "DBL"-rooms available |*
>* | from 2015-11-24 to 2015-11-28 : 9 "DBL"-rooms available |*