From 3259e9d702451eae8965688c62c167913c73df34 Mon Sep 17 00:00:00 2001 From: Eike Stepper Date: Fri, 25 Sep 2015 12:37:17 +0200 Subject: [297142] Provide more documentation https://bugs.eclipse.org/bugs/show_bug.cgi?id=297142--- .../operators/Doc01_ConfiguringRepositories.html | 2 +- .../html/operators/index.html | 4 +- .../html/users/Doc01_UserInterface.html | 2 +- .../html/users/Doc05_UsingCheckouts.html | 2 +- .../html/users/Doc06_UsingResources.html | 2 +- .../html/users/Doc07_UsingModels.html | 10 +- .../html/users/Doc08_Collaborating.html | 180 +++++++++++++++ .../html/users/Doc08_TechnicalBackground.html | 206 ----------------- .../html/users/Doc09_TechnicalBackground.html | 206 +++++++++++++++++ .../html/users/collaborating.png | Bin 0 -> 43951 bytes .../html/users/early-conflict.png | Bin 0 -> 11398 bytes .../org.eclipse.emf.cdo.doc/html/users/index.html | 31 ++- .../html/users/late-conflict.png | Bin 0 -> 23658 bytes .../html/users/pessimistic-locking.png | Bin 0 -> 31061 bytes .../operators/Doc01_ConfiguringRepositories.java | 2 +- .../emf/cdo/doc/users/Doc01_UserInterface.java | 2 +- .../emf/cdo/doc/users/Doc05_UsingCheckouts.java | 2 +- .../emf/cdo/doc/users/Doc06_UsingResources.java | 2 +- .../emf/cdo/doc/users/Doc07_UsingModels.java | 4 +- .../emf/cdo/doc/users/Doc08_Collaborating.java | 194 ++++++++++++++++ .../cdo/doc/users/Doc08_TechnicalBackground.java | 246 --------------------- .../cdo/doc/users/Doc09_TechnicalBackground.java | 246 +++++++++++++++++++++ .../eclipse/emf/cdo/doc/users/collaborating.png | Bin 0 -> 43951 bytes .../eclipse/emf/cdo/doc/users/early-conflict.png | Bin 0 -> 11398 bytes .../eclipse/emf/cdo/doc/users/late-conflict.png | Bin 0 -> 23658 bytes .../emf/cdo/doc/users/pessimistic-locking.png | Bin 0 -> 31061 bytes plugins/org.eclipse.emf.cdo.doc/toc.html | 3 +- plugins/org.eclipse.emf.cdo.doc/toc.xml | 3 +- plugins/org.eclipse.emf.cdo.releng/help/toc.html | 3 +- 29 files changed, 869 insertions(+), 483 deletions(-) create mode 100644 plugins/org.eclipse.emf.cdo.doc/html/users/Doc08_Collaborating.html delete mode 100644 plugins/org.eclipse.emf.cdo.doc/html/users/Doc08_TechnicalBackground.html create mode 100644 plugins/org.eclipse.emf.cdo.doc/html/users/Doc09_TechnicalBackground.html create mode 100644 plugins/org.eclipse.emf.cdo.doc/html/users/collaborating.png create mode 100644 plugins/org.eclipse.emf.cdo.doc/html/users/early-conflict.png create mode 100644 plugins/org.eclipse.emf.cdo.doc/html/users/late-conflict.png create mode 100644 plugins/org.eclipse.emf.cdo.doc/html/users/pessimistic-locking.png create mode 100644 plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc08_Collaborating.java delete mode 100644 plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc08_TechnicalBackground.java create mode 100644 plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc09_TechnicalBackground.java create mode 100644 plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/collaborating.png create mode 100644 plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/early-conflict.png create mode 100644 plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/late-conflict.png create mode 100644 plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/pessimistic-locking.png diff --git a/plugins/org.eclipse.emf.cdo.doc/html/operators/Doc01_ConfiguringRepositories.html b/plugins/org.eclipse.emf.cdo.doc/html/operators/Doc01_ConfiguringRepositories.html index 01b84ef44c..4f9d2b78ed 100644 --- a/plugins/org.eclipse.emf.cdo.doc/html/operators/Doc01_ConfiguringRepositories.html +++ b/plugins/org.eclipse.emf.cdo.doc/html/operators/Doc01_ConfiguringRepositories.html @@ -243,7 +243,7 @@ function windowTitle()

Specifies whether the repository will support the storage of instances of the Ecore (meta meta) model or not.

- With the advent of the legacy mode in CDO 3.0 you can store instances of any model in CDO repositories. + With the advent of the legacy mode in CDO 3.0 you can store instances of any model in CDO repositories. Whether these models have been generated for CDO or not only influences their characteristics (scalability, performance, etc.). As a consequence you can also store instances of the Ecore (meta meta) model in CDO Repositories. Since Ecore is always registered in all package registries the legacy mode would lead to the creation of mapped tables in many types of stores, diff --git a/plugins/org.eclipse.emf.cdo.doc/html/operators/index.html b/plugins/org.eclipse.emf.cdo.doc/html/operators/index.html index 81778117d7..2a47eb5d36 100644 --- a/plugins/org.eclipse.emf.cdo.doc/html/operators/index.html +++ b/plugins/org.eclipse.emf.cdo.doc/html/operators/index.html @@ -23,7 +23,7 @@ function windowTitle() - +

Operator's Guide

  

@@ -71,7 +71,7 @@ function windowTitle()

- 

+ 


Copyright (c) 2011, 2012, 2015 Eike Stepper (Berlin, Germany) and others. diff --git a/plugins/org.eclipse.emf.cdo.doc/html/users/Doc01_UserInterface.html b/plugins/org.eclipse.emf.cdo.doc/html/users/Doc01_UserInterface.html index 49f73c3261..c1636fc99c 100644 --- a/plugins/org.eclipse.emf.cdo.doc/html/users/Doc01_UserInterface.html +++ b/plugins/org.eclipse.emf.cdo.doc/html/users/Doc01_UserInterface.html @@ -233,7 +233,7 @@ function windowTitle() diff --git a/plugins/org.eclipse.emf.cdo.doc/html/users/Doc05_UsingCheckouts.html b/plugins/org.eclipse.emf.cdo.doc/html/users/Doc05_UsingCheckouts.html index ec7f246fe6..5f26b61e82 100644 --- a/plugins/org.eclipse.emf.cdo.doc/html/users/Doc05_UsingCheckouts.html +++ b/plugins/org.eclipse.emf.cdo.doc/html/users/Doc05_UsingCheckouts.html @@ -430,7 +430,7 @@ function windowTitle() Updating an offline checkout is a remote operation.

See Also:

diff --git a/plugins/org.eclipse.emf.cdo.doc/html/users/Doc06_UsingResources.html b/plugins/org.eclipse.emf.cdo.doc/html/users/Doc06_UsingResources.html index 23e5246096..8a2fed0bc8 100644 --- a/plugins/org.eclipse.emf.cdo.doc/html/users/Doc06_UsingResources.html +++ b/plugins/org.eclipse.emf.cdo.doc/html/users/Doc06_UsingResources.html @@ -32,7 +32,7 @@ function windowTitle() consists of folders and different types of resources, all categorized as resource nodes.

All modifications of the resource tree that are triggered in the Project Explorer - are performed in a separate background transaction, see Technical Background of Transactions for details. + are performed in a separate background transaction, see Technical Background of Transactions for details.

Modifying the resource tree is only possible in checkouts that are not read-only, i.e., not in Online Historical Checkouts.

diff --git a/plugins/org.eclipse.emf.cdo.doc/html/users/Doc07_UsingModels.html b/plugins/org.eclipse.emf.cdo.doc/html/users/Doc07_UsingModels.html index 7ebaae0a45..96949fd872 100644 --- a/plugins/org.eclipse.emf.cdo.doc/html/users/Doc07_UsingModels.html +++ b/plugins/org.eclipse.emf.cdo.doc/html/users/Doc07_UsingModels.html @@ -23,14 +23,14 @@ function windowTitle() - +

Working with Models and Model Elements

  

Author: Eike Stepper

All modifications of model elements that are triggered in the Project Explorer (as opposed to being triggered in a model editor) - are performed in a separate background transaction, see Technical Background of Transactions for details. + are performed in a separate background transaction, see Technical Background of Transactions for details.

Modifying model elements is only possible in checkouts that are not read-only, i.e., not in Online Historical Checkouts.

@@ -60,7 +60,7 @@ function windowTitle() or an existing model element that can have children, opening the context menu and opening the New sub menu. This sub menu looks different depending on the type of the container. It is explained in the following two sub sections.

See Also:

@@ -151,10 +151,10 @@ function windowTitle()

All registered model editors open their own, separate transaction, which is typically committed when the editor is saved. - See Technical Background of Transactions for details on how transactions are typically used by editors. + See Technical Background of Transactions for details on how transactions are typically used by editors.

- 

+ 


Copyright (c) 2011, 2012, 2015 Eike Stepper (Berlin, Germany) and others. diff --git a/plugins/org.eclipse.emf.cdo.doc/html/users/Doc08_Collaborating.html b/plugins/org.eclipse.emf.cdo.doc/html/users/Doc08_Collaborating.html new file mode 100644 index 0000000000..7ca0ea701f --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.doc/html/users/Doc08_Collaborating.html @@ -0,0 +1,180 @@ + + + + +Collaborating in Real-Time (CDO Model Repository Documentation) + + + + + + + + + + + + + + + +

Collaborating in Real-Time

 
+

Author: Eike Stepper

+

+ CDO supports real-time collaboration on models by transferring the changes that one user + commits to the repository to all + other users connected to the same repository and transparently weaving those changes into their model copies. +

+ +

+ With CDO the local model copies (in particular with online transactional checkouts) do not need to be + updated manually; they are automatically updated (almost) at the time they are changed by other users. +

+ As real-time collaboration relies on committing a transaction it applies only to + online transactional checkouts and the editors + opened on online transactional models. Saving a model editor commits the underlying transaction. +

+ The data integrity of the models and model elements in a repository is guaranteed by write locks + that are acquired per model element. Read locks and write options, + as well as durable locks are supported by the core-level APIs + but not by the CDO Explorer's user interface. +

+ Table of Contents

+ + + + + + + + + +
Optimistic Locking
1.1 Early Conflict Detection
1.2 Automatic Conflict Resolution
1.3 Interactive Conflict Resolution
Pessimistic Locking
2.1 Tree Locking
Automatic Locking
Automatic Committing
+

+ + +

1  Optimistic Locking

+

+ By default model elements are locked optimistically, that is, the CDO server implicitly acquires and releases locks while executing + a commit operation. These implicit locks are not visible to the committing user or any other user of the same repository. +

+ Optimistic locking provides for the highest possible degree of concurrency but it also comes with a non-zero risk of commit conflicts + that are only detected when a commit operation is executed by the CDO server and, as a consequence, rejected. Because of + Early Conflict Detection the risk of conflicts that are detected that late in the commit process is generally much lower + than, for example, in pure database-based applications. +

+ To completely eliminate the risk of commit conflicts Pessimistic Locking must be used. + +

1.1  Early Conflict Detection

+

+ As the local model copies of a user are automatically updated (almost) at the time they are changed by other users + CDO can anticipate the conflict potential of the local changes early, in particular before an attempt to commit these changes is even made. + The CDO Model Editor decorates such conflicting model elements with a red-colored font, + indicating that the underlying transaction can not be successfully committed anymore. +

+ +

+ Automatic Conflict Resolution and Interactive Conflict Resolution, if enabled, may have an impact on what exact types + of changes are considered a conflict. + +

1.2  Automatic Conflict Resolution

+

+ Each time a local transaction is notified of a remote change by the CDO server and local conflicts are detected (see Early Conflict Detection) + these conflicts are categorized as being either trivial conflicts or non-trivial conflicts. Trivial conflicts are: +

+

+ Trivial conflicts are merged automatically into the local transaction, i.e., no user interaction is involved. +

+ When non-trivial changes are detected, i.e., changes to the same single-valued feature on both sides (local and remote) + of the same model element, automatic conflict resolution is suspended for all model elements until the next local commit operation. + During this period all incoming change notifications are accumulated and remembered for possible Interactive Conflict Resolution + at commit time. + +

1.3  Interactive Conflict Resolution

+

+ If Automatic Conflict Resolution has detected non-trivial conflicts in a local transaction and + an attempt is made to commit this transaction the following dialog pops up: +

+ +

+ The dialog shows an overview of how many local model elements are added, changed, and removed. One of several conflict resolution + actions has to be selected by the user: +

+ +

2  Pessimistic Locking

+

+ Sometimes it seems not desirable to risk commit conflicts as they can occur with Optimistic Locking. + In these cases CDO supports the acquisition of explicit locks on selected models (see Tree Locking) and model elements. +

+ Pessimistic locking support consists of: +

+

+ Whether custom user interface components, such as model editors or views, support local actions and/or lock state visualization depends + on the implementation of those components. The CDO Model Editor's context menu offers lock actions for model elements that are not locked + by anyone and unlock actions for model elements that are locked by the current user. Both the CDO Model Editor and the + Project Explorer Integration support lock state visualization by decorating model elements that are locked by the current user + with a green lock icon (indicating that they can be modified) and model elements that are locked by other users with a red lock icon + (indicating that they can not be modified): +

+ +

+ Note that a CDO editor generally operates in the context of a separate transaction, in particular not in the context of the + read-only view of the associated checkout, which explains why, in the screen shot above, both checkouts show the + locked model elements with a red lock icon decoration. In other words, while a model element is locked in a CDO editor it can not be + modified directly in the associated checkout via the Project Explorer. + +

2.1  Tree Locking

+

+ Sometimes it is desirable to lock not just a single model element but to atomically lock the tree of model elements rooted at the + selected model element. The CDO Model Editor's context menu offers a Lock Tree action for model elements that are not locked by + anyone and an Unlock Tree action for model elements that are locked by the current user. + +

3  Automatic Locking

+

+ With automatic locking turned on for a particular transaction write locks are automatically acquired + for model elements at the time these model elements are modified the first time. +

+ Automatic locking is not yet supported for checkouts. + +

4  Automatic Committing

+

+ With automatic committing turned on for a particular transaction that transaction is automatically committed + each time a model element is modified. This can be very useful when the primary purpose of a repository is to support real-time + collaboration between a number of users. +

+ On the other hand with automatic committing multiple logically related changes are no longer + isolated in single composed commits. This can be especially undesirable in repositories with auditing or branching support + because the databases of these types of repositories monotonously grow with the number of commits. +

+ Automatic committing is not yet supported for checkouts. + +

+ 

+
+Copyright (c) 2011, 2012, 2015 Eike Stepper (Berlin, Germany) and others. + + diff --git a/plugins/org.eclipse.emf.cdo.doc/html/users/Doc08_TechnicalBackground.html b/plugins/org.eclipse.emf.cdo.doc/html/users/Doc08_TechnicalBackground.html deleted file mode 100644 index fdaeb7d818..0000000000 --- a/plugins/org.eclipse.emf.cdo.doc/html/users/Doc08_TechnicalBackground.html +++ /dev/null @@ -1,206 +0,0 @@ - - - - -Understanding the Technical Background (CDO Model Repository Documentation) - - - - - - - - - - - - - - - -

Understanding the Technical Background

 
-

Author: Eike Stepper

-

- This article explains the relationship between the main concepts that are exposed in the - CDO User Interface and their underlying technical core concepts. -

- -

- Table of Contents

- - - - - - - - - - - -
Technical Background of Model Elements
1.1 Native Models
1.2 Legacy Models
1.3 Dynamic Models
Technical Background of Repositories
Technical Background of Checkouts
Technical Background of Sessions
Technical Background of Views
Technical Background of Transactions
Technical Background of the Compare Integration
-

- - -

1  Technical Background of Model Elements

-

- Model elements are EObjects. -

- EObjects are instances of concrete EClasses, sometimes referred to as model element types. -

- EClasses are contained by EPackages, often referred to as meta models and sometimes less specifically as just models. -

- EPackages are registered in the EPackage.Registry.

See Also:

- - - -

1.1  Native Models

-

- The term "native model" refers to an EPackage that is generated - with some CDO-specific options to fully exploit CDO's unprecedented - characteristics with respect to scalability and performance. -

- Native model elements are lazily loaded when they are needed and automatically garbage-collected when they are no longer needed. - Repositories with native model elements can scale to arbitrary sizes. Clients may not be able to load all objects - of these large repositories at the same time, but they are able, for example, to iterate all objects of a large repository - without worrying about memory management. -

- Technically native model elements are instances of the Java class CDOObjectImpl.

See Also:

- - - -

1.2  Legacy Models

-

- Generating or regenerating an EPackage with the CDO-specific options - (as explained in Native Models) is not always possible, for example if an EPackage has already - been generated by a third party. In these cases the original generated EPackage can still be used with CDO; - and is then referred to as a "legacy model". -

- The integration of legacy models with CDO is based on CDOLegacyAdapters. -

- Legacy model elements are not loaded lazily and not automatically garbage-collected. - -

1.3  Dynamic Models

-

- It is not strictly necessary for an EPackage to be generated into Java code to be used with CDO. - An EPackage can also be loaded dynamically at runtime (see Creating an Ecore Model for an example of the - XML representation of an EPackage). -

- Technically dynamic model elements are instances of the Java class DynamicCDOObjectImpl. -

- Dynamic model elements share the characteristics of native model elements - with respect to enhanced scalability and performance, - -

2  Technical Background of Repositories

-

- The term "repository" is a slightly ambiguous in CDO, as it may refer to both a server-side / core-level IRepository - and a client-side / UI-level CDORepository. -

- An IRepository is a "real" repository backed by a physical database (of one of various forms). In production - such repositories typically exist in a CDO server - that provides remote access through one or more ITCPConnectors. - The Operator's Guide explains how to configure and operate a CDO server. -

- A CDORepository is more of a configured connection to a "real" IRepository, which - is remembered across Eclipse sessions. In the case of a local repository (connection) - an internal IRepository is created with an H2 database stored on the local disk. -

- Internally a connected CDORepository maintains a single CDOSession to the underlying IRepository. - This session is shared by all views and transactions of all checkouts - from that CDORepository.

See Also:

- - - -

3  Technical Background of Checkouts

-

- A CDOCheckout is not necessarily a physical copy of a repository on the local disk (only offline checkouts - maintain a locally replicated repository copy). More generally they represent the following two aspects: -

-

- A CDOCheckout internally maintains a main CDOView that is, for example, used to provide the resources and model elements that - are displayed in the Project Explorer. As objects that are provided by CDOViews are read-only - any modification action on these objects, for example as offered in the various context menus or triggered by drag and drop events, - operates on transactional copies of the objects in the context of a background thread. -

- Each model editor opened on a resource or model element of a CDOCheckout typically - (but depending on the implementation of that editor) maintains its own CDOTransaction to isolate changes and locks from other - views and transactions. Typically the save action of a model editor delegates directly to the commit - method of its associated CDOTransaction. - -

4  Technical Background of Sessions

-

- A CDOSession is the technical representation of a CDOProtocol connection to an IRepository. - On the transport level this connection is provided by an IConnector / IAcceptor pair. -

-

See Also:

- - - -

5  Technical Background of Views

-

- A CDOView is a technical facility that provides a client application with all the models and model elements in a repository - for a specific point in time and in a specific branch. - The model elements provided by a CDOView are read-only. -

-

See Also:

- - - -

6  Technical Background of Transactions

-

- A CDOTransaction is a technical facility that provides a client application with all the latest models - and model elements in a repository in a specific branch. - The model elements provided by a CDOTransaction are writable. - Changes to these model elements must be committed to make them - persistent in the repository and to distribute them to the views and transactions of other users. -

-

See Also:

- - - -

7  Technical Background of the Compare Integration

-

- With CDO both EMF Compare editors and EMF Merge editors are instrumented to utilize an optimized CDO mechanism in order to compute - matches in a very efficient and scalable way. This mechanism consists of special client-server protocol - and remote database queries to determine and deliver the object IDs that are involved in all changes - between two different CDOBranchPoints. The response times depend on the implementation of the backend storage. - The response time of the default implementation, the DBStore, scales more - with the sizes of the stored meta models (i.e., the number of concrete EClasses) than with the sizes of the stored models - (i.e., the number of EObjects). - -

- 

-
-Copyright (c) 2011, 2012, 2015 Eike Stepper (Berlin, Germany) and others. - - diff --git a/plugins/org.eclipse.emf.cdo.doc/html/users/Doc09_TechnicalBackground.html b/plugins/org.eclipse.emf.cdo.doc/html/users/Doc09_TechnicalBackground.html new file mode 100644 index 0000000000..00e6e94c96 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.doc/html/users/Doc09_TechnicalBackground.html @@ -0,0 +1,206 @@ + + + + +Understanding the Technical Background (CDO Model Repository Documentation) + + + + + + + + + + + + + + + +

Understanding the Technical Background

 
+

Author: Eike Stepper

+

+ This article explains the relationship between the main concepts that are exposed in the + CDO User Interface and their underlying technical core concepts. +

+ +

+ Table of Contents

+ + + + + + + + + + + +
Technical Background of Model Elements
1.1 Native Models
1.2 Legacy Models
1.3 Dynamic Models
Technical Background of Repositories
Technical Background of Checkouts
Technical Background of Sessions
Technical Background of Views
Technical Background of Transactions
Technical Background of the Compare Integration
+

+ + +

1  Technical Background of Model Elements

+

+ Model elements are EObjects. +

+ EObjects are instances of concrete EClasses, sometimes referred to as model element types. +

+ EClasses are contained by EPackages, often referred to as meta models and sometimes less specifically as just models. +

+ EPackages are registered in the EPackage.Registry.

See Also:

+ + + +

1.1  Native Models

+

+ The term "native model" refers to an EPackage that is generated + with some CDO-specific options to fully exploit CDO's unprecedented + characteristics with respect to scalability and performance. +

+ Native model elements are lazily loaded when they are needed and automatically garbage-collected when they are no longer needed. + Repositories with native model elements can scale to arbitrary sizes. Clients may not be able to load all objects + of these large repositories at the same time, but they are able, for example, to iterate all objects of a large repository + without worrying about memory management. +

+ Technically native model elements are instances of the Java class CDOObjectImpl.

See Also:

+ + + +

1.2  Legacy Models

+

+ Generating or regenerating an EPackage with the CDO-specific options + (as explained in Native Models) is not always possible, for example if an EPackage has already + been generated by a third party. In these cases the original generated EPackage can still be used with CDO; + and is then referred to as a "legacy model". +

+ The integration of legacy models with CDO is based on CDOLegacyAdapters. +

+ Legacy model elements are not loaded lazily and not automatically garbage-collected. + +

1.3  Dynamic Models

+

+ It is not strictly necessary for an EPackage to be generated into Java code to be used with CDO. + An EPackage can also be loaded dynamically at runtime (see Creating an Ecore Model for an example of the + XML representation of an EPackage). +

+ Technically dynamic model elements are instances of the Java class DynamicCDOObjectImpl. +

+ Dynamic model elements share the characteristics of native model elements + with respect to enhanced scalability and performance, + +

2  Technical Background of Repositories

+

+ The term "repository" is a slightly ambiguous in CDO, as it may refer to both a server-side / core-level IRepository + and a client-side / UI-level CDORepository. +

+ An IRepository is a "real" repository backed by a physical database (of one of various forms). In production + such repositories typically exist in a CDO server + that provides remote access through one or more ITCPConnectors. + The Operator's Guide explains how to configure and operate a CDO server. +

+ A CDORepository is more of a configured connection to a "real" IRepository, which + is remembered across Eclipse sessions. In the case of a local repository (connection) + an internal IRepository is created with an H2 database stored on the local disk. +

+ Internally a connected CDORepository maintains a single CDOSession to the underlying IRepository. + This session is shared by all views and transactions of all checkouts + from that CDORepository.

See Also:

+ + + +

3  Technical Background of Checkouts

+

+ A CDOCheckout is not necessarily a physical copy of a repository on the local disk (only offline checkouts + maintain a locally replicated repository copy). More generally they represent the following two aspects: +

+

+ A CDOCheckout internally maintains a main CDOView that is, for example, used to provide the resources and model elements that + are displayed in the Project Explorer. As objects that are provided by CDOViews are read-only + any modification action on these objects, for example as offered in the various context menus or triggered by drag and drop events, + operates on transactional copies of the objects in the context of a background thread. +

+ Each model editor opened on a resource or model element of a CDOCheckout typically + (but depending on the implementation of that editor) maintains its own CDOTransaction to isolate changes and locks from other + views and transactions. Typically the save action of a model editor delegates directly to the commit + method of its associated CDOTransaction. + +

4  Technical Background of Sessions

+

+ A CDOSession is the technical representation of a CDOProtocol connection to an IRepository. + On the transport level this connection is provided by an IConnector / IAcceptor pair. +

+

See Also:

+ + + +

5  Technical Background of Views

+

+ A CDOView is a technical facility that provides a client application with all the models and model elements in a repository + for a specific point in time and in a specific branch. + The model elements provided by a CDOView are read-only. +

+

See Also:

+ + + +

6  Technical Background of Transactions

+

+ A CDOTransaction is a technical facility that provides a client application with all the latest models + and model elements in a repository in a specific branch. + The model elements provided by a CDOTransaction are writable. + Changes to these model elements must be committed to make them + persistent in the repository and to distribute them to the views and transactions of other users. +

+

See Also:

+ + + +

7  Technical Background of the Compare Integration

+

+ With CDO both EMF Compare editors and EMF Merge editors are instrumented to utilize an optimized CDO mechanism in order to compute + matches in a very efficient and scalable way. This mechanism consists of special client-server protocol + and remote database queries to determine and deliver the object IDs that are involved in all changes + between two different CDOBranchPoints. The response times depend on the implementation of the backend storage. + The response time of the default implementation, the DBStore, scales more + with the sizes of the stored meta models (i.e., the number of concrete EClasses) than with the sizes of the stored models + (i.e., the number of EObjects). + +

+ 

+
+Copyright (c) 2011, 2012, 2015 Eike Stepper (Berlin, Germany) and others. + + diff --git a/plugins/org.eclipse.emf.cdo.doc/html/users/collaborating.png b/plugins/org.eclipse.emf.cdo.doc/html/users/collaborating.png new file mode 100644 index 0000000000..bab1426b66 Binary files /dev/null and b/plugins/org.eclipse.emf.cdo.doc/html/users/collaborating.png differ diff --git a/plugins/org.eclipse.emf.cdo.doc/html/users/early-conflict.png b/plugins/org.eclipse.emf.cdo.doc/html/users/early-conflict.png new file mode 100644 index 0000000000..6ccfa95274 Binary files /dev/null and b/plugins/org.eclipse.emf.cdo.doc/html/users/early-conflict.png differ diff --git a/plugins/org.eclipse.emf.cdo.doc/html/users/index.html b/plugins/org.eclipse.emf.cdo.doc/html/users/index.html index 63bb0c6f86..0fe702e934 100644 --- a/plugins/org.eclipse.emf.cdo.doc/html/users/index.html +++ b/plugins/org.eclipse.emf.cdo.doc/html/users/index.html @@ -123,17 +123,26 @@ function windowTitle() 4 Deleting Model ElementsEditing Model Elements in a DialogEditing Model Elements in an Editor - Understanding the Technical Background -1 Technical Background of Model Elements -1.1 Native Models -1.2 Legacy Models -1.3 Dynamic Models -2 Technical Background of Repositories -3 Technical Background of Checkouts -4 Technical Background of Sessions -5 Technical Background of Views -6 Technical Background of Transactions -7 Technical Background of the Compare Integration + Collaborating in Real-Time +1 Optimistic Locking +1.1 Early Conflict Detection +1.2 Automatic Conflict Resolution +1.3 Interactive Conflict Resolution +2 Pessimistic Locking +2.1 Tree Locking +3 Automatic Locking +4 Automatic Committing + Understanding the Technical Background +1 Technical Background of Model Elements +1.1 Native Models +1.2 Legacy Models +1.3 Dynamic Models +2 Technical Background of Repositories +3 Technical Background of Checkouts +4 Technical Background of Sessions +5 Technical Background of Views +6 Technical Background of Transactions +7 Technical Background of the Compare Integration

diff --git a/plugins/org.eclipse.emf.cdo.doc/html/users/late-conflict.png b/plugins/org.eclipse.emf.cdo.doc/html/users/late-conflict.png new file mode 100644 index 0000000000..4b10eae2e2 Binary files /dev/null and b/plugins/org.eclipse.emf.cdo.doc/html/users/late-conflict.png differ diff --git a/plugins/org.eclipse.emf.cdo.doc/html/users/pessimistic-locking.png b/plugins/org.eclipse.emf.cdo.doc/html/users/pessimistic-locking.png new file mode 100644 index 0000000000..158c03da95 Binary files /dev/null and b/plugins/org.eclipse.emf.cdo.doc/html/users/pessimistic-locking.png differ diff --git a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/operators/Doc01_ConfiguringRepositories.java b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/operators/Doc01_ConfiguringRepositories.java index b94b832783..e32c3f0eb5 100644 --- a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/operators/Doc01_ConfiguringRepositories.java +++ b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/operators/Doc01_ConfiguringRepositories.java @@ -10,7 +10,7 @@ */ package org.eclipse.emf.cdo.doc.operators; -import org.eclipse.emf.cdo.doc.users.Doc08_TechnicalBackground.Doc_BackgroundModelElements.Doc_BackgroundLegacyModels; +import org.eclipse.emf.cdo.doc.users.Doc09_TechnicalBackground.Doc_BackgroundModelElements.Doc_BackgroundLegacyModels; import org.eclipse.emf.cdo.server.IRepository; import org.eclipse.emf.cdo.server.IStore; import org.eclipse.emf.cdo.server.db.mapping.ColumnTypeModifier; diff --git a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc01_UserInterface.java b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc01_UserInterface.java index fa8467f1b0..b4297de3d0 100644 --- a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc01_UserInterface.java +++ b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc01_UserInterface.java @@ -18,7 +18,7 @@ import org.eclipse.emf.cdo.doc.users.Doc04_CheckingOut.Doc_CheckoutType.Doc_Offl import org.eclipse.emf.cdo.doc.users.Doc04_CheckingOut.Doc_CheckoutType.Doc_TransactionalCheckouts; import org.eclipse.emf.cdo.doc.users.Doc05_UsingCheckouts.Doc_ComparingCheckouts; import org.eclipse.emf.cdo.doc.users.Doc07_UsingModels.Doc_EditingModelElements; -import org.eclipse.emf.cdo.doc.users.Doc08_TechnicalBackground.Doc_BackgroundCompare; +import org.eclipse.emf.cdo.doc.users.Doc09_TechnicalBackground.Doc_BackgroundCompare; import org.eclipse.emf.cdo.session.remote.CDORemoteSessionManager; import org.eclipse.emf.cdo.view.CDOView.Options; diff --git a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc05_UsingCheckouts.java b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc05_UsingCheckouts.java index 2436e328d1..64cfd3d825 100644 --- a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc05_UsingCheckouts.java +++ b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc05_UsingCheckouts.java @@ -29,7 +29,7 @@ import org.eclipse.emf.cdo.doc.users.Doc03_UsingBranches.Doc_CreatingBranches; import org.eclipse.emf.cdo.doc.users.Doc04_CheckingOut.Doc_CheckoutType.Doc_HistoricalCheckouts; import org.eclipse.emf.cdo.doc.users.Doc04_CheckingOut.Doc_CheckoutType.Doc_OfflineCheckouts; import org.eclipse.emf.cdo.doc.users.Doc04_CheckingOut.Doc_CheckoutType.Doc_TransactionalCheckouts; -import org.eclipse.emf.cdo.doc.users.Doc08_TechnicalBackground.Doc_BackgroundCompare; +import org.eclipse.emf.cdo.doc.users.Doc09_TechnicalBackground.Doc_BackgroundCompare; import org.eclipse.emf.cdo.explorer.checkouts.CDOCheckout; import org.eclipse.emf.cdo.session.CDOSession; import org.eclipse.emf.cdo.transaction.CDOTransaction; diff --git a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc06_UsingResources.java b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc06_UsingResources.java index 1d48136c05..0082b94eb9 100644 --- a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc06_UsingResources.java +++ b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc06_UsingResources.java @@ -12,7 +12,7 @@ package org.eclipse.emf.cdo.doc.users; import org.eclipse.emf.cdo.doc.users.Doc01_UserInterface.Doc_ProjectExplorerIntegration; import org.eclipse.emf.cdo.doc.users.Doc04_CheckingOut.Doc_CheckoutType.Doc_HistoricalCheckouts; -import org.eclipse.emf.cdo.doc.users.Doc08_TechnicalBackground.Doc_BackgroundTransactions; +import org.eclipse.emf.cdo.doc.users.Doc09_TechnicalBackground.Doc_BackgroundTransactions; import org.eclipse.emf.cdo.eresource.CDOBinaryResource; import org.eclipse.emf.cdo.eresource.CDOResource; import org.eclipse.emf.cdo.eresource.CDOResourceFolder; diff --git a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc07_UsingModels.java b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc07_UsingModels.java index 125c66cfae..6d156d103c 100644 --- a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc07_UsingModels.java +++ b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc07_UsingModels.java @@ -14,8 +14,8 @@ import org.eclipse.emf.cdo.doc.online.EMFFormsGuide; import org.eclipse.emf.cdo.doc.users.Doc01_UserInterface.Doc_ProjectExplorerIntegration; import org.eclipse.emf.cdo.doc.users.Doc04_CheckingOut.Doc_CheckoutType.Doc_HistoricalCheckouts; import org.eclipse.emf.cdo.doc.users.Doc06_UsingResources.Doc_CreatingResourceNodes.Doc_CreatingModelResources; -import org.eclipse.emf.cdo.doc.users.Doc08_TechnicalBackground.Doc_BackgroundModelElements; -import org.eclipse.emf.cdo.doc.users.Doc08_TechnicalBackground.Doc_BackgroundTransactions; +import org.eclipse.emf.cdo.doc.users.Doc09_TechnicalBackground.Doc_BackgroundModelElements; +import org.eclipse.emf.cdo.doc.users.Doc09_TechnicalBackground.Doc_BackgroundTransactions; import org.eclipse.emf.cdo.transaction.CDOTransaction; import org.eclipse.emf.cdo.transfer.CDOTransfer; import org.eclipse.emf.cdo.ui.CDOEditorOpener; diff --git a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc08_Collaborating.java b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc08_Collaborating.java new file mode 100644 index 0000000000..9e69fa0f6c --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc08_Collaborating.java @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2015 Eike Stepper (Berlin, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + */ +package org.eclipse.emf.cdo.doc.users; + +import org.eclipse.emf.cdo.doc.users.Doc01_UserInterface.Doc_ProjectExplorerIntegration; +import org.eclipse.emf.cdo.doc.users.Doc04_CheckingOut.Doc_CheckoutType.Doc_TransactionalCheckouts; +import org.eclipse.emf.cdo.doc.users.Doc07_UsingModels.Doc_EditingModelElementsEditor; +import org.eclipse.emf.cdo.transaction.CDOTransaction; +import org.eclipse.emf.cdo.view.CDOView; + +import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType; + +import org.eclipse.emf.ecore.EStructuralFeature; + +/** + * Collaborating in Real-Time + *

+ * CDO supports real-time collaboration on models by transferring the changes that one user + * {@link CDOTransaction#commit(org.eclipse.core.runtime.IProgressMonitor) commits} to the repository to all + * other users connected to the same repository and transparently weaving those changes into their model copies. + * {@img collaborating.png} + *

+ * With CDO the local model copies (in particular with {@link Doc_TransactionalCheckouts online transactional checkouts}) do not need to be + * updated manually; they are automatically updated (almost) at the time they are changed by other users. + *

+ * As real-time collaboration relies on committing a {@link CDOTransaction transaction} it applies only to + * online transactional checkouts and the {@link Doc_EditingModelElementsEditor editors} + * opened on online transactional models. Saving a model editor commits the underlying transaction. + *

+ * The data integrity of the models and model elements in a repository is guaranteed by {@link LockType#WRITE write locks} + * that are acquired per model element. {@link LockType#READ Read locks} and {@link LockType#OPTION write options}, + * as well as {@link CDOView#enableDurableLocking() durable locks} are supported by the core-level APIs + * but not by the CDO Explorer's user interface. + *

+ * Table of Contents {@toc} + * + * @author Eike Stepper + */ +public class Doc08_Collaborating +{ + /** + * Optimistic Locking + *

+ * By default model elements are locked optimistically, that is, the CDO server implicitly acquires and releases locks while executing + * a commit operation. These implicit locks are not visible to the committing user or any other user of the same repository. + *

+ * Optimistic locking provides for the highest possible degree of concurrency but it also comes with a non-zero risk of commit conflicts + * that are only detected when a commit operation is executed by the CDO server and, as a consequence, rejected. Because of + * {@link Doc_EarlyConflictDetection} the risk of conflicts that are detected that late in the commit process is generally much lower + * than, for example, in pure database-based applications. + *

+ * To completely eliminate the risk of commit conflicts {@link Doc_PessimisticLocking} must be used. + */ + public class Doc_OptimisticLocking + { + /** + * Early Conflict Detection + *

+ * As the local model copies of a user are automatically updated (almost) at the time they are changed by other users + * CDO can anticipate the conflict potential of the local changes early, in particular before an attempt to commit these changes is even made. + * The {@link Doc_EditingModelElementsEditor CDO Model Editor} decorates such conflicting model elements with a red-colored font, + * indicating that the underlying {@link CDOTransaction transaction} can not be successfully committed anymore. + * {@img early-conflict.png} + *

+ * {@link Doc_AutomaticConflictResolution} and {@link Doc_InteractiveConflictResolution}, if enabled, may have an impact on what exact types + * of changes are considered a conflict. + */ + public class Doc_EarlyConflictDetection + { + } + + /** + * Automatic Conflict Resolution + *

+ * Each time a local transaction is notified of a remote change by the CDO server and local conflicts are detected (see {@link Doc_EarlyConflictDetection}) + * these conflicts are categorized as being either trivial conflicts or non-trivial conflicts. Trivial conflicts are: + *

+ *

+ * Trivial conflicts are merged automatically into the local transaction, i.e., no user interaction is involved. + *

+ * When non-trivial changes are detected, i.e., changes to the same single-valued {@link EStructuralFeature feature} on both sides (local and remote) + * of the same model element, automatic conflict resolution is suspended for all model elements until the next local commit operation. + * During this period all incoming change notifications are accumulated and remembered for possible {@link Doc_InteractiveConflictResolution} + * at commit time. + */ + public class Doc_AutomaticConflictResolution + { + } + + /** + * Interactive Conflict Resolution + *

+ * If {@link Doc_AutomaticConflictResolution} has detected non-trivial conflicts in a local {@link CDOTransaction transaction} and + * an attempt is made to commit this transaction the following dialog pops up: + * {@img late-conflict.png} + *

+ * The dialog shows an overview of how many local model elements are added, changed, and removed. One of several conflict resolution + * actions has to be selected by the user: + *

+ */ + public class Doc_InteractiveConflictResolution + { + } + } + + /** + * Pessimistic Locking + *

+ * Sometimes it seems not desirable to risk commit conflicts as they can occur with {@link Doc_OptimisticLocking}. + * In these cases CDO supports the acquisition of explicit locks on selected models (see {@link Doc_TreeLocking}) and model elements. + *

+ * Pessimistic locking support consists of: + *

+ *

+ * Whether custom user interface components, such as model editors or views, support local actions and/or lock state visualization depends + * on the implementation of those components. The CDO Model Editor's context menu offers lock actions for model elements that are not locked + * by anyone and unlock actions for model elements that are locked by the current user. Both the CDO Model Editor and the + * {@link Doc_ProjectExplorerIntegration} support lock state visualization by decorating model elements that are locked by the current user + * with a green lock icon (indicating that they can be modified) and model elements that are locked by other users with a red lock icon + * (indicating that they can not be modified): + * {@img pessimistic-locking.png} + *

+ * Note that a CDO editor generally operates in the context of a separate transaction, in particular not in the context of the + * {@link CDOView read-only view} of the associated checkout, which explains why, in the screen shot above, both checkouts show the + * locked model elements with a red lock icon decoration. In other words, while a model element is locked in a CDO editor it can not be + * modified directly in the associated checkout via the Project Explorer. + */ + public class Doc_PessimisticLocking + { + /** + * Tree Locking + *

+ * Sometimes it is desirable to lock not just a single model element but to atomically lock the tree of model elements rooted at the + * selected model element. The CDO Model Editor's context menu offers a Lock Tree action for model elements that are not locked by + * anyone and an Unlock Tree action for model elements that are locked by the current user. + */ + public class Doc_TreeLocking + { + } + } + + /** + * Automatic Locking + *

+ * With automatic locking turned on for a particular {@link CDOTransaction transaction} write locks are automatically acquired + * for model elements at the time these model elements are modified the first time. + *

+ * Automatic locking is not yet supported for checkouts. + */ + public class Doc_AutomaticLocking + { + } + + /** + * Automatic Committing + *

+ * With automatic committing turned on for a particular {@link CDOTransaction transaction} that transaction is automatically committed + * each time a model element is modified. This can be very useful when the primary purpose of a repository is to support real-time + * collaboration between a number of users. + *

+ * On the other hand with automatic committing multiple logically related changes are no longer + * isolated in single composed commits. This can be especially undesirable in repositories with auditing or branching support + * because the databases of these types of repositories monotonously grow with the number of commits. + *

+ * Automatic committing is not yet supported for checkouts. + */ + public class Doc_AutomaticCommitting + { + } +} diff --git a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc08_TechnicalBackground.java b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc08_TechnicalBackground.java deleted file mode 100644 index eab32421fc..0000000000 --- a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc08_TechnicalBackground.java +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Copyright (c) 2015 Eike Stepper (Berlin, Germany) and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Eike Stepper - initial API and implementation - */ -package org.eclipse.emf.cdo.doc.users; - -import org.eclipse.emf.cdo.common.branch.CDOBranchPoint; -import org.eclipse.emf.cdo.common.id.CDOID; -import org.eclipse.emf.cdo.common.protocol.CDOProtocol; -import org.eclipse.emf.cdo.doc.online.CDOScalability; -import org.eclipse.emf.cdo.doc.online.EMFDeveloperGuide; -import org.eclipse.emf.cdo.doc.programmers.client.Doc02_PreparingModels; -import org.eclipse.emf.cdo.doc.programmers.client.Doc02_PreparingModels.Doc_CreatingEcore; -import org.eclipse.emf.cdo.doc.programmers.client.Doc02_PreparingModels.Doc_GeneratingModel; -import org.eclipse.emf.cdo.doc.programmers.client.Doc02_PreparingModels.Doc_MigratingManually; -import org.eclipse.emf.cdo.doc.users.Doc01_UserInterface.Doc_ProjectExplorerIntegration; -import org.eclipse.emf.cdo.doc.users.Doc01_UserInterface.Doc_SessionsView; -import org.eclipse.emf.cdo.doc.users.Doc02_ManagingRepositories.Doc_CreatingRepositories; -import org.eclipse.emf.cdo.doc.users.Doc02_ManagingRepositories.Doc_CreatingRepositories.Doc_LocalRepositories; -import org.eclipse.emf.cdo.doc.users.Doc02_ManagingRepositories.Doc_RepositoryShowIn.Doc_RepositoryShowInSystemExplorer; -import org.eclipse.emf.cdo.doc.users.Doc04_CheckingOut.Doc_CheckoutType.Doc_OfflineCheckouts; -import org.eclipse.emf.cdo.doc.users.Doc07_UsingModels.Doc_EditingModelElementsEditor; -import org.eclipse.emf.cdo.explorer.checkouts.CDOCheckout; -import org.eclipse.emf.cdo.explorer.repositories.CDORepository; -import org.eclipse.emf.cdo.server.IRepository; -import org.eclipse.emf.cdo.server.IStore; -import org.eclipse.emf.cdo.session.CDOSession; -import org.eclipse.emf.cdo.transaction.CDOTransaction; -import org.eclipse.emf.cdo.util.ReadOnlyException; -import org.eclipse.emf.cdo.view.CDOView; - -import org.eclipse.emf.internal.cdo.CDOObjectImpl; - -import org.eclipse.net4j.acceptor.IAcceptor; -import org.eclipse.net4j.connector.IConnector; -import org.eclipse.net4j.db.h2.H2Adapter; -import org.eclipse.net4j.tcp.ITCPConnector; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EPackage.Registry; -import org.eclipse.emf.spi.cdo.CDOSessionProtocol; - -/** - * Understanding the Technical Background - *

- * This article explains the relationship between the main concepts that are exposed in the - * {@link Doc01_UserInterface CDO User Interface} and their underlying technical core concepts. - * {@img tech-overview.png} - *

- * Table of Contents {@toc} - * - * @author Eike Stepper - */ -public class Doc08_TechnicalBackground -{ - /** - * Technical Background of Model Elements - *

- * Model elements are {@link EObject EObjects}. - *

- * EObjects are instances of concrete {@link EClass EClasses}, sometimes referred to as model element types. - *

- * EClasses are contained by {@link EPackage EPackages}, often referred to as meta models and sometimes less specifically as just models. - *

- * EPackages are registered in the {@link Registry EPackage.Registry}. - * - * @see EMFDeveloperGuide - */ - public class Doc_BackgroundModelElements - { - /** - * Native Models - *

- * The term "native model" refers to an {@link EPackage} that is {@link Doc_GeneratingModel generated} - * with some CDO-specific {@link Doc_MigratingManually options} to fully exploit CDO's unprecedented - * characteristics with respect to scalability and performance. - *

- * Native model elements are lazily loaded when they are needed and automatically garbage-collected when they are no longer needed. - * Repositories with native model elements can scale to arbitrary sizes. Clients may not be able to load all objects - * of these large repositories at the same time, but they are able, for example, to iterate all objects of a large repository - * without worrying about memory management. - *

- * Technically native model elements are instances of the Java class {@link CDOObjectImpl}. - * - * @see CDOScalability - * @see Doc02_PreparingModels - */ - public class Doc_BackgroundNativeModels - { - } - - /** - * Legacy Models - *

- * Generating or regenerating an {@link EPackage} with the CDO-specific {@link Doc_MigratingManually options} - * (as explained in {@link Doc_BackgroundNativeModels}) is not always possible, for example if an EPackage has already - * been generated by a third party. In these cases the original generated EPackage can still be used with CDO; - * and is then referred to as a "legacy model". - *

- * The integration of legacy models with CDO is based on CDOLegacyAdapters. - *

- * Legacy model elements are not loaded lazily and not automatically garbage-collected. - */ - public class Doc_BackgroundLegacyModels - { - } - - /** - * Dynamic Models - *

- * It is not strictly necessary for an {@link EPackage} to be generated into Java code to be used with CDO. - * An EPackage can also be loaded dynamically at runtime (see {@link Doc_CreatingEcore} for an example of the - * XML representation of an EPackage). - *

- * Technically dynamic model elements are instances of the Java class DynamicCDOObjectImpl. - *

- * Dynamic model elements share the characteristics of {@link Doc_BackgroundNativeModels native} model elements - * with respect to enhanced scalability and performance, - */ - public class Doc_BackgroundDynamicModels - { - } - } - - /** - * Technical Background of Repositories - *

- * The term "repository" is a slightly ambiguous in CDO, as it may refer to both a server-side / core-level {@link IRepository} - * and a client-side / UI-level {@link CDORepository}. - *

- * An IRepository is a "real" repository backed by a physical database (of one of various {@link IStore forms)}. In production - * such repositories typically exist in a CDO server - * that provides remote access through one or more {@link ITCPConnector ITCPConnectors}. - * The {@link org.eclipse.emf.cdo.doc.operators} explains how to configure and operate a CDO server. - *

- * A CDORepository is more of a {@link Doc_CreatingRepositories configured connection} to a "real" IRepository, which - * is remembered across Eclipse sessions. In the case of a {@link Doc_LocalRepositories local repository} (connection) - * an internal IRepository is created with an {@link H2Adapter H2} database {@link Doc_RepositoryShowInSystemExplorer stored on the local disk}. - *

- * Internally a {@link CDORepository#isConnected() connected} CDORepository maintains a single {@link CDOSession} to the underlying IRepository. - * This session is shared by all {@link CDOView views} and {@link CDOTransaction transactions} of all {@link CDOCheckout checkouts} - * from that CDORepository. - * - * @see Doc02_ManagingRepositories - * @see Doc_BackgroundSessions - */ - public class Doc_BackgroundRepositories - { - } - - /** - * Technical Background of Checkouts - *

- * A {@link CDOCheckout} is not necessarily a physical copy of a repository on the local disk (only {@link Doc_OfflineCheckouts offline checkouts} - * maintain a locally replicated repository copy). More generally they represent the following two aspects: - *

- *

- * A CDOCheckout internally maintains a main CDOView that is, for example, used to provide the resources and model elements that - * are displayed in the {@link Doc_ProjectExplorerIntegration Project Explorer}. As objects that are provided by CDOViews are read-only - * any modification action on these objects, for example as offered in the various context menus or triggered by drag and drop events, - * operates on {@link CDOView#getObject(EObject) transactional copies} of the objects in the context of a background thread. - *

- * Each {@link Doc_EditingModelElementsEditor model editor} opened on a resource or model element of a CDOCheckout typically - * (but depending on the implementation of that editor) maintains its own CDOTransaction to isolate changes and locks from other - * views and transactions. Typically the save action of a model editor delegates directly to the {@link CDOTransaction#commit(org.eclipse.core.runtime.IProgressMonitor) commit} - * method of its associated CDOTransaction. - */ - public class Doc_BackgroundCheckouts - { - } - - /** - * Technical Background of Sessions - *

- * A {@link CDOSession} is the technical representation of a {@link CDOProtocol} connection to an {@link IRepository}. - * On the transport level this connection is provided by an {@link IConnector} / {@link IAcceptor} pair. - * {@img tech-sessions.png} - * - * @see Doc_SessionsView - * @see Doc_BackgroundViews - * @see Doc_BackgroundTransactions - */ - public class Doc_BackgroundSessions - { - } - - /** - * Technical Background of Views - *

- * A {@link CDOView} is a technical facility that provides a client application with all the models and model elements in a repository - * for a specific {@link CDOBranchPoint#getTimeStamp() point in time} and in a specific {@link CDOBranchPoint#getBranch() branch}. - * The model elements provided by a CDOView are {@link ReadOnlyException read-only}. - * {@img tech-views.png} - * - * @see Doc_BackgroundSessions - * @see Doc_BackgroundCheckouts - */ - public class Doc_BackgroundViews - { - } - - /** - * Technical Background of Transactions - *

- * A {@link CDOTransaction} is a technical facility that provides a client application with all the latest models - * and model elements in a repository in a specific {@link CDOBranchPoint#getBranch() branch}. - * The model elements provided by a CDOTransaction are writable. - * Changes to these model elements must be {@link CDOTransaction#commit(org.eclipse.core.runtime.IProgressMonitor) committed} to make them - * persistent in the repository and to distribute them to the views and transactions of other users. - * {@img tech-transactions.png} - * - * @see Doc_BackgroundSessions - * @see Doc_BackgroundCheckouts - */ - public class Doc_BackgroundTransactions - { - } - - /** - * Technical Background of the Compare Integration - *

- * With CDO both EMF Compare editors and EMF Merge editors are instrumented to utilize an optimized CDO mechanism in order to compute - * matches in a very efficient and scalable way. This mechanism consists of special {@link CDOSessionProtocol#loadMergeData(org.eclipse.emf.cdo.spi.common.commit.CDORevisionAvailabilityInfo, org.eclipse.emf.cdo.spi.common.commit.CDORevisionAvailabilityInfo, org.eclipse.emf.cdo.spi.common.commit.CDORevisionAvailabilityInfo, org.eclipse.emf.cdo.spi.common.commit.CDORevisionAvailabilityInfo) client-server protocol} - * and remote database queries to determine and deliver the {@link CDOID object IDs} that are involved in all changes - * between two different {@link CDOBranchPoint CDOBranchPoints}. The response times depend on the implementation of the {@link IStore backend storage}. - * The response time of the default implementation, the DBStore, scales more - * with the sizes of the stored meta models (i.e., the number of concrete {@link EClass EClasses}) than with the sizes of the stored models - * (i.e., the number of {@link EObject EObjects}). - */ - public class Doc_BackgroundCompare - { - } -} diff --git a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc09_TechnicalBackground.java b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc09_TechnicalBackground.java new file mode 100644 index 0000000000..8046c111aa --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/Doc09_TechnicalBackground.java @@ -0,0 +1,246 @@ +/* + * Copyright (c) 2015 Eike Stepper (Berlin, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + */ +package org.eclipse.emf.cdo.doc.users; + +import org.eclipse.emf.cdo.common.branch.CDOBranchPoint; +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.protocol.CDOProtocol; +import org.eclipse.emf.cdo.doc.online.CDOScalability; +import org.eclipse.emf.cdo.doc.online.EMFDeveloperGuide; +import org.eclipse.emf.cdo.doc.programmers.client.Doc02_PreparingModels; +import org.eclipse.emf.cdo.doc.programmers.client.Doc02_PreparingModels.Doc_CreatingEcore; +import org.eclipse.emf.cdo.doc.programmers.client.Doc02_PreparingModels.Doc_GeneratingModel; +import org.eclipse.emf.cdo.doc.programmers.client.Doc02_PreparingModels.Doc_MigratingManually; +import org.eclipse.emf.cdo.doc.users.Doc01_UserInterface.Doc_ProjectExplorerIntegration; +import org.eclipse.emf.cdo.doc.users.Doc01_UserInterface.Doc_SessionsView; +import org.eclipse.emf.cdo.doc.users.Doc02_ManagingRepositories.Doc_CreatingRepositories; +import org.eclipse.emf.cdo.doc.users.Doc02_ManagingRepositories.Doc_CreatingRepositories.Doc_LocalRepositories; +import org.eclipse.emf.cdo.doc.users.Doc02_ManagingRepositories.Doc_RepositoryShowIn.Doc_RepositoryShowInSystemExplorer; +import org.eclipse.emf.cdo.doc.users.Doc04_CheckingOut.Doc_CheckoutType.Doc_OfflineCheckouts; +import org.eclipse.emf.cdo.doc.users.Doc07_UsingModels.Doc_EditingModelElementsEditor; +import org.eclipse.emf.cdo.explorer.checkouts.CDOCheckout; +import org.eclipse.emf.cdo.explorer.repositories.CDORepository; +import org.eclipse.emf.cdo.server.IRepository; +import org.eclipse.emf.cdo.server.IStore; +import org.eclipse.emf.cdo.session.CDOSession; +import org.eclipse.emf.cdo.transaction.CDOTransaction; +import org.eclipse.emf.cdo.util.ReadOnlyException; +import org.eclipse.emf.cdo.view.CDOView; + +import org.eclipse.emf.internal.cdo.CDOObjectImpl; + +import org.eclipse.net4j.acceptor.IAcceptor; +import org.eclipse.net4j.connector.IConnector; +import org.eclipse.net4j.db.h2.H2Adapter; +import org.eclipse.net4j.tcp.ITCPConnector; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EPackage.Registry; +import org.eclipse.emf.spi.cdo.CDOSessionProtocol; + +/** + * Understanding the Technical Background + *

+ * This article explains the relationship between the main concepts that are exposed in the + * {@link Doc01_UserInterface CDO User Interface} and their underlying technical core concepts. + * {@img tech-overview.png} + *

+ * Table of Contents {@toc} + * + * @author Eike Stepper + */ +public class Doc09_TechnicalBackground +{ + /** + * Technical Background of Model Elements + *

+ * Model elements are {@link EObject EObjects}. + *

+ * EObjects are instances of concrete {@link EClass EClasses}, sometimes referred to as model element types. + *

+ * EClasses are contained by {@link EPackage EPackages}, often referred to as meta models and sometimes less specifically as just models. + *

+ * EPackages are registered in the {@link Registry EPackage.Registry}. + * + * @see EMFDeveloperGuide + */ + public class Doc_BackgroundModelElements + { + /** + * Native Models + *

+ * The term "native model" refers to an {@link EPackage} that is {@link Doc_GeneratingModel generated} + * with some CDO-specific {@link Doc_MigratingManually options} to fully exploit CDO's unprecedented + * characteristics with respect to scalability and performance. + *

+ * Native model elements are lazily loaded when they are needed and automatically garbage-collected when they are no longer needed. + * Repositories with native model elements can scale to arbitrary sizes. Clients may not be able to load all objects + * of these large repositories at the same time, but they are able, for example, to iterate all objects of a large repository + * without worrying about memory management. + *

+ * Technically native model elements are instances of the Java class {@link CDOObjectImpl}. + * + * @see CDOScalability + * @see Doc02_PreparingModels + */ + public class Doc_BackgroundNativeModels + { + } + + /** + * Legacy Models + *

+ * Generating or regenerating an {@link EPackage} with the CDO-specific {@link Doc_MigratingManually options} + * (as explained in {@link Doc_BackgroundNativeModels}) is not always possible, for example if an EPackage has already + * been generated by a third party. In these cases the original generated EPackage can still be used with CDO; + * and is then referred to as a "legacy model". + *

+ * The integration of legacy models with CDO is based on CDOLegacyAdapters. + *

+ * Legacy model elements are not loaded lazily and not automatically garbage-collected. + */ + public class Doc_BackgroundLegacyModels + { + } + + /** + * Dynamic Models + *

+ * It is not strictly necessary for an {@link EPackage} to be generated into Java code to be used with CDO. + * An EPackage can also be loaded dynamically at runtime (see {@link Doc_CreatingEcore} for an example of the + * XML representation of an EPackage). + *

+ * Technically dynamic model elements are instances of the Java class DynamicCDOObjectImpl. + *

+ * Dynamic model elements share the characteristics of {@link Doc_BackgroundNativeModels native} model elements + * with respect to enhanced scalability and performance, + */ + public class Doc_BackgroundDynamicModels + { + } + } + + /** + * Technical Background of Repositories + *

+ * The term "repository" is a slightly ambiguous in CDO, as it may refer to both a server-side / core-level {@link IRepository} + * and a client-side / UI-level {@link CDORepository}. + *

+ * An IRepository is a "real" repository backed by a physical database (of one of various {@link IStore forms)}. In production + * such repositories typically exist in a CDO server + * that provides remote access through one or more {@link ITCPConnector ITCPConnectors}. + * The {@link org.eclipse.emf.cdo.doc.operators} explains how to configure and operate a CDO server. + *

+ * A CDORepository is more of a {@link Doc_CreatingRepositories configured connection} to a "real" IRepository, which + * is remembered across Eclipse sessions. In the case of a {@link Doc_LocalRepositories local repository} (connection) + * an internal IRepository is created with an {@link H2Adapter H2} database {@link Doc_RepositoryShowInSystemExplorer stored on the local disk}. + *

+ * Internally a {@link CDORepository#isConnected() connected} CDORepository maintains a single {@link CDOSession} to the underlying IRepository. + * This session is shared by all {@link CDOView views} and {@link CDOTransaction transactions} of all {@link CDOCheckout checkouts} + * from that CDORepository. + * + * @see Doc02_ManagingRepositories + * @see Doc_BackgroundSessions + */ + public class Doc_BackgroundRepositories + { + } + + /** + * Technical Background of Checkouts + *

+ * A {@link CDOCheckout} is not necessarily a physical copy of a repository on the local disk (only {@link Doc_OfflineCheckouts offline checkouts} + * maintain a locally replicated repository copy). More generally they represent the following two aspects: + *

+ *

+ * A CDOCheckout internally maintains a main CDOView that is, for example, used to provide the resources and model elements that + * are displayed in the {@link Doc_ProjectExplorerIntegration Project Explorer}. As objects that are provided by CDOViews are read-only + * any modification action on these objects, for example as offered in the various context menus or triggered by drag and drop events, + * operates on {@link CDOView#getObject(EObject) transactional copies} of the objects in the context of a background thread. + *

+ * Each {@link Doc_EditingModelElementsEditor model editor} opened on a resource or model element of a CDOCheckout typically + * (but depending on the implementation of that editor) maintains its own CDOTransaction to isolate changes and locks from other + * views and transactions. Typically the save action of a model editor delegates directly to the {@link CDOTransaction#commit(org.eclipse.core.runtime.IProgressMonitor) commit} + * method of its associated CDOTransaction. + */ + public class Doc_BackgroundCheckouts + { + } + + /** + * Technical Background of Sessions + *

+ * A {@link CDOSession} is the technical representation of a {@link CDOProtocol} connection to an {@link IRepository}. + * On the transport level this connection is provided by an {@link IConnector} / {@link IAcceptor} pair. + * {@img tech-sessions.png} + * + * @see Doc_SessionsView + * @see Doc_BackgroundViews + * @see Doc_BackgroundTransactions + */ + public class Doc_BackgroundSessions + { + } + + /** + * Technical Background of Views + *

+ * A {@link CDOView} is a technical facility that provides a client application with all the models and model elements in a repository + * for a specific {@link CDOBranchPoint#getTimeStamp() point in time} and in a specific {@link CDOBranchPoint#getBranch() branch}. + * The model elements provided by a CDOView are {@link ReadOnlyException read-only}. + * {@img tech-views.png} + * + * @see Doc_BackgroundSessions + * @see Doc_BackgroundCheckouts + */ + public class Doc_BackgroundViews + { + } + + /** + * Technical Background of Transactions + *

+ * A {@link CDOTransaction} is a technical facility that provides a client application with all the latest models + * and model elements in a repository in a specific {@link CDOBranchPoint#getBranch() branch}. + * The model elements provided by a CDOTransaction are writable. + * Changes to these model elements must be {@link CDOTransaction#commit(org.eclipse.core.runtime.IProgressMonitor) committed} to make them + * persistent in the repository and to distribute them to the views and transactions of other users. + * {@img tech-transactions.png} + * + * @see Doc_BackgroundSessions + * @see Doc_BackgroundCheckouts + */ + public class Doc_BackgroundTransactions + { + } + + /** + * Technical Background of the Compare Integration + *

+ * With CDO both EMF Compare editors and EMF Merge editors are instrumented to utilize an optimized CDO mechanism in order to compute + * matches in a very efficient and scalable way. This mechanism consists of special {@link CDOSessionProtocol#loadMergeData(org.eclipse.emf.cdo.spi.common.commit.CDORevisionAvailabilityInfo, org.eclipse.emf.cdo.spi.common.commit.CDORevisionAvailabilityInfo, org.eclipse.emf.cdo.spi.common.commit.CDORevisionAvailabilityInfo, org.eclipse.emf.cdo.spi.common.commit.CDORevisionAvailabilityInfo) client-server protocol} + * and remote database queries to determine and deliver the {@link CDOID object IDs} that are involved in all changes + * between two different {@link CDOBranchPoint CDOBranchPoints}. The response times depend on the implementation of the {@link IStore backend storage}. + * The response time of the default implementation, the DBStore, scales more + * with the sizes of the stored meta models (i.e., the number of concrete {@link EClass EClasses}) than with the sizes of the stored models + * (i.e., the number of {@link EObject EObjects}). + */ + public class Doc_BackgroundCompare + { + } +} diff --git a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/collaborating.png b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/collaborating.png new file mode 100644 index 0000000000..bab1426b66 Binary files /dev/null and b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/collaborating.png differ diff --git a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/early-conflict.png b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/early-conflict.png new file mode 100644 index 0000000000..6ccfa95274 Binary files /dev/null and b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/early-conflict.png differ diff --git a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/late-conflict.png b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/late-conflict.png new file mode 100644 index 0000000000..4b10eae2e2 Binary files /dev/null and b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/late-conflict.png differ diff --git a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/pessimistic-locking.png b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/pessimistic-locking.png new file mode 100644 index 0000000000..158c03da95 Binary files /dev/null and b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/users/pessimistic-locking.png differ diff --git a/plugins/org.eclipse.emf.cdo.doc/toc.html b/plugins/org.eclipse.emf.cdo.doc/toc.html index 2e6532d071..f41b16db76 100644 --- a/plugins/org.eclipse.emf.cdo.doc/toc.html +++ b/plugins/org.eclipse.emf.cdo.doc/toc.html @@ -10,7 +10,8 @@

Working with Checkouts
Working with Folders and Resources
Working with Models and Model Elements
-
Understanding the Technical Background
+
Collaborating in Real-Time
+
Understanding the Technical Background
Operator's Guide
Operator's Guide