on master help sign in
add some documentation for autoMergeToHead
55bbfa9AgentM
README.markdown+1−1
@@ -35,7 +35,7 @@ Project:M36 supports multiple frontends which target different audiences.
35* [Developer's Blog](https://agentm.github.io/project-m36/)
35* [Developer's Blog](https://agentm.github.io/project-m36/)
36* [Mailing List/Discussion Group](https://groups.google.com/d/forum/project-m36)
36* [Mailing List/Discussion Group](https://groups.google.com/d/forum/project-m36)
37* IRC Channel: chat.freenode.net #project-m36
37* IRC Channel: chat.freenode.net #project-m36
38−* [Hackage](https://hackage.haskell.org/package/project-m36-0.1)
38+* [Hackage](https://hackage.haskell.org/package/project-m36)
39
39
40## Documentation
40## Documentation
41
41
docs/projectm36_client_library.markdown+12
@@ -30,6 +30,18 @@ maybeErr <- executeDatabaseContextExpr conn (Define "person" (attributesFromList
30maybeErr <- executeGraphExpr conn (JumpToHead "branch2")
30maybeErr <- executeGraphExpr conn (JumpToHead "branch2")
31```
31```
32
32
33+## Dealing with Concurrency
34+
35+As in all databases, transactions contend concurrently for access to the the latest database state. Unlike most DBMSs, Project:M36 features multiple heads to reduce contention. Still, at a high transaction rate, Project:M36 clients would still be likely to receive lots of ```TransactionIsNotAHeadError```s because the server's head has received additional commits by the time a client wants to commit its own transaction. To reduce the incidence of this error, the server offers an ```autoMergeToHead``` function which:
36+
37+1. creates a temporary branch
38+1. commits the current disconnected transaction to the temporary branch
39+1. attempts a merge back to the original branch
40+
41+The operations above occur atomically on the server. The purpose of this "automerge" is to reduce reliance on repeated client attempts to commit when head contention is high. The trade-off is that the client must handle any merge errors or use a different merge strategy.
42+
43+This feature is similar to git's ```rebase``` functionality except that the merge occurs server side and is fully validated and committed, if possible.
44+
33## Cleanup
45## Cleanup
34
46
351. Close the connection
471. Close the connection