Multiple instances of this kind of data store may be created against the same repository, possibly working against different {@link #setHead(String) heads}.
A head is any commit in GeoGig. If a head has a branch pointing at it then the store allows transactions, otherwise no data modifications may be made. A branch in Geogig is a separate line of history that may or may not share a common ancestor with another branch. In the later case the branch is called "orphan" and by convention the default branch is called "master", which is created when the geogig repo is first initialized, but does not necessarily exist.
Every read operation (like in {@link #getFeatureSource(Name)}) reads committed features out of the configured "head" branch. Write operations are only supported if a {@link Transaction} isset, in which case a {@link GeogigTransaction} is tied to the geotools transaction by means of a{@link GeogigTransactionState}. During the transaction, read operations will read from the transaction's {@link WorkingTree} in order to "see" features that haven't been committed yet.
When the transaction is committed, the changes made inside that transaction are merged onto the actual repository. If any other change was made to the repository meanwhile, a rebase will be attempted, and the transaction commit will fail if the rebase operation finds any conflict. This provides for optimistic locking and reduces thread contention.
|
|