CDO >> Basic concepts (Session, View, Transaction, ...)
VIEW contains SESSION, a map of LOCKSTATE Map<CDOObject, CDOLockState>
TRANSACTION contains first/last SAVE POINT, TRANSACTION STRATEGY
SESSION contains PACKAGE REGISTRY, BRANCH MANAGER, REVISION MANAGER, COMMIT INFO MANAGER, SESSION PROTOCOL, REPOSITORY INFO,
a read/write LOCK MANAGER IRWOLockManager<CDOSessionImpl, Object>, a CREDENTIAL PROVIDER, a REMOTE SESSION MANAGER
A CDOView is a read-only view to the state of the object graph in the repository of the underlying SESSION at a specific TIME
at a specific BRANCH. If the TIME of a view is unspecified the objects provided and managed by that VIEW always show the
latest state the repository graph.
Objects that are accessed through this VIEW are immutable for the client. Each attempt to call a mutator on one of these
objects or one of their feature lists will result in a ReadOnlyException being thrown immediately.
Mutable objects can be provided by a TRANSACTION.
A VIEW is opened through API of the underlying SESSION like this:
CDOSession session = ...
CDOView view = session.openView();
...
CDOViewImpl
> CDOSession getSession():
- Returns the session this view was opened by
> lockObjects/unlockObjects(Collection<? extends CDOObject> objects, LockType lockType, long timeout):
- Locks/unlockObjects the given objects. Once the objects are locked, they will not be changed remotely or
go in conflict state.
> setBranchPoint(CDOBranch branch, long timeStamp):
- Sets the branch and the point in (repository) time this VIEW should refer to. Objects provided by this VIEW
will be valid at this TIME
> enableDurableLocking():
- Enables the storage of all information that's needed to reopen this VIEW at a later point in TIME.
This information includes the BRANCH POINT, the user ID of the SESSION, whether it's a read-only VIEW
or a TRANSACTION and all the LOCKs that are acquired or will be acquired while DURABLE LOCKING is enabled.
> getLastUpdateTime():
Returns the time stamp of the last commit operation.
> waitForUpdate(long updateTime, long timeoutMillis):
Blocks the calling thread until a commit operation with the given time stamp (or higher) has occured or
the given timeout has expired
A TRANSACTION (CDOTransaction) is a read-write VIEW to the current (i.e. latest) state of the object graph in the repository
CDOTransactionImpl
> isDirty():
- Returns true if this TRANSACTION is not closed and contains uncommitted changes, false otherwise
> hasConflict():
- Returns true if this transaction contains local modifications that are conflicting with remote
modifications, false otherwise
> getObject(CDOID id, boolean loadOnDemand):
- Returns the object for the given CDOID
Configures and opens new SESSIONs.
A SESSION CONFIGURATION can fire the following events:
CDOSessionConfiguration.SessionOpenedEvent after a SESSION has been opened by this CONFIGURATION.
A SESSION represents and controls the connection to a model repository in addition to the inherited VIEW management functions.
A SESSION has the following responsibilities:
> CDORepositoryInfo information
> Package registry
> Data management
> View management
Note that in order to retrieve, access and store objects a VIEW is needed. The various openXYZ methods are provided for this purpose.
A SESSION can fire the following events:
> CDOSessionInvalidationEvent after commit notifications have been received and processed.
> CDOSessionLocksChangedEvent after locks have been acquired or released.
CDOSessionImpl:
> getRepositoryInfo():
- Returns an instance of CDORepositoryInfo that describes the model REPOSITORY this SESSION is connected to.
> getPackageRegistry():
- Returns the EMF PACKAGE REGISTRY that is used by all objects of all VIEWs of this SESSION. All PACKAGEs
that are already persisted in the REPOSITORY of this SESSION are automatically registered with this REGISTRY
> getBranchManager():
- Returns the CDO branch manager that manages the BRANCHes of the REPOSITORY of this SESSION
> getRevisionManager():
- Returns the CDO REVISION manager that manages the REVISIONs of the REPOSITORY of this SESSION
> getCommitInfoManager():
- Returns the CDO COMMIT info manager of this SESSION
> getFetchRuleManager():
- Returns the CDO FETCH RULE manager of this SESSION
> getCredentialsProvider():
- Returns the CREDENTIAL PROVIDER of this SESSION
> getRemoteSessionManager():
- Returns the CDO REMOTE SESSION MANAGER that keeps track of the other REMOTE SESSIONs served
by the REPOSITORY of this LOCAL SESSION
Represents a REMOTE SESSION that is connected to the same repository as the local SESSION that the
REMOTE SESSION manager points to
A read or write LOCK on an object as returned by CDOObject.cdoReadLock() or CDOObject.cdoWriteLock()