Package org.eclipse.emf.cdo.transaction

# Interface CDOTransaction

All Superinterfaces:
  `CDOBranchPoint`, `CDOBranchProvider`, `CDOChangeSetDataProvider`, `CDOCommitHistory.Provider<CDOObject,CDOObjectHistory>`, `CDOCommonTransaction`, `CDOCommonView`, `CDORevisionProvider`, `CDOTimeProvider`, `CDOUpdatable`, `CDOUserTransaction`, `CDOView`, `org.eclipse.net4j.util.collection.Closeable`, `IAdaptable`, `org.eclipse.net4j.util.container.IContainer<CDOResourceNode>`, `org.eclipse.net4j.util.event.INotifier`, `org.eclipse.net4j.util.options.IOptionsContainer`, `org.eclipse.net4j.util.properties.IPropertiesContainer`

All Known Subinterfaces:
  `InternalCDOTransaction`

All Known Implementing Classes:
  `CDOPushTransaction`

public interface CDOTransaction extends CDOView, CDOCommonTransaction, CDOUserTransaction, CDOChangeSetDataProvider
A read-write view to the current (i.e. latest) state of the object graph in the repository.

Since:
  2.0
Author:
  Eike Stepper
No Implement
  This interface is not intended to be implemented by clients.
No Extend
  This interface is not intended to be extended by clients.

## Nested Class Summary

Nested Classes
Modifier and Type
Interface
Description
`static final class`
`CDOTransaction.CommitResult<T>`
A value type that combines the result of a persistable computation and the `commit info` of the final `transaction commit`.
`static interface`
`CDOTransaction.Options`
Encapsulates a set of notifying `transaction` configuration options.

## Nested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IContainer

`org.eclipse.net4j.util.container.IContainer.Modifiable<E extends Object>, org.eclipse.net4j.util.container.IContainer.Persistable<E extends Object>, org.eclipse.net4j.util.container.IContainer.Persistence<E extends Object>`

## Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier

`org.eclipse.net4j.util.event.INotifier.INotifier2`

## Field Summary

### Fields inherited from interface org.eclipse.emf.cdo.common.branch.CDOBranchPoint

`INVALID_DATE, UNSPECIFIED_DATE`

### Fields inherited from interface org.eclipse.emf.cdo.util.CDOUpdatable

`NO_TIMEOUT`

### Fields inherited from interface org.eclipse.emf.cdo.view.CDOView

`PROP_LIFECYCLE_EXCEPTION_HANDLER, PROP_TIME_MACHINE_DISABLED`

## Method Summary

Modifier and Type
Method
Description
`void`
`addTransactionHandler(CDOTransactionHandlerBase handler)`
`CDOCommitInfo`
`commit(Runnable runnable, int attempts, IProgressMonitor monitor)`
`CDOCommitInfo`
`commit(Runnable runnable, Predicate<Long> retry, IProgressMonitor monitor)`
`CDOCommitInfo`
`commit(Runnable runnable, org.eclipse.net4j.util.Predicate<Long> retry, IProgressMonitor monitor)`
Deprecated.
As of 4.9 use `commit(Runnable, java.util.function.Predicate, IProgressMonitor)`.
`<T> CDOTransaction.CommitResult<T>`
`commit(Callable<T> callable, int attempts, IProgressMonitor monitor)`
`<T> CDOTransaction.CommitResult<T>`
`commit(Callable<T> callable, Predicate<Long> retry, IProgressMonitor monitor)`
`<T> CDOTransaction.CommitResult<T>`
`commit(Callable<T> callable, org.eclipse.net4j.util.Predicate<Long> retry, IProgressMonitor monitor)`
Deprecated.
As of 4.9 use `commit(Callable, java.util.function.Predicate, IProgressMonitor)`.
`CDOCommitInfo`
`commitAndClose(IProgressMonitor monitor, boolean keepOpenAfterCommitProblem)`
`CDOBinaryResource`
`createBinaryResource(String path)`
`CDOQuery`
`createQuery(String language, String queryString, boolean considerDirtyState)`
`CDOQuery`
`createQuery(String language, String queryString, Object context, boolean considerDirtyState)`
`CDOResource`
`createResource(String path)`
`CDOResourceFolder`
`createResourceFolder(String path)`
`CDOTextResource`
`createTextResource(String path)`
`CDOSavepoint[]`
`exportChanges(OutputStream out)`
`String`
`getCommitComment()`
Returns the comment to be used in the next commit operation.
`Set<? extends EObject>`
`getCommittables()`
`Set<CDOObject>`
`getConflicts()`
Returns the set of objects that are conflicting with remote modifications or an empty set if `hasConflict()` returns `false`.
`Map<CDOID,CDOObject>`
`getDetachedObjects()`
`Map<CDOID,CDOObject>`
`getDirtyObjects()`
`CDOSavepoint`
`getFirstSavepoint()`
`long`
`getLastCommitTime()`
`CDOSavepoint`
`getLastSavepoint()`
`Map<CDOID,CDOObject>`
`getNewObjects()`
`CDOBinaryResource`
`getOrCreateBinaryResource(String path)`
`CDOResource`
`getOrCreateResource(String path)`
`CDOResourceFolder`
`getOrCreateResourceFolder(String path)`
`CDOTextResource`
`getOrCreateTextResource(String path)`
`Map<CDOID,CDORevisionDelta>`
`getRevisionDeltas()`
`CDOTransactionHandler[]`
`getTransactionHandlers()`
`CDOTransactionHandler1[]`
`getTransactionHandlers1()`
`CDOTransactionHandler2[]`
`getTransactionHandlers2()`
`boolean`
`hasConflict()`
Returns `true` if this transaction contains local modifications that are conflicting with remote modifications, `false` otherwise.
`CDOSavepoint[]`
`importChanges(InputStream in, boolean reconstructSavepoints)`
`boolean`
`isDirty()`
Returns `true` if this transaction is not closed and contains uncommitted changes, `false` otherwise.
`CDOChangeSetData`
`merge(CDOBranchPoint source, CDOBranchPoint sourceBase, CDOBranchPoint targetBase, CDOMerger merger)`
Merges the changes between the given source base point and the given source point into this transaction.
`CDOChangeSetData`
`merge(CDOBranchPoint source, CDOBranchPoint sourceBase, CDOMerger merger)`
Merges the changes between the given source base point and the given source point into this transaction.
`CDOChangeSetData`
`merge(CDOBranchPoint source, CDOMerger merger)`
Merges the changes from the given source point into this transaction and possibly considers previous merges from that `branch` by inspecting the `merge source` information of the `commit history`.
`CDOChangeSetData`
`merge(CDOBranch source, CDOMerger merger)`
Merges the changes from the given source branch into this transaction and possibly considers previous merges from that branch by inspecting the `merge source` information of the `commit history`.
`CDOTransaction.Options`
`options()`
Returns the `options` of this view.
`void`
`removeTransactionHandler(CDOTransactionHandlerBase handler)`
`CDOChangeSetData`
`revertTo(CDOBranchPoint branchPoint)`
`void`
`setCommitComment(String comment)`
Sets the comment to be used in the next commit operation.
`void`
`setCommittables(Set<? extends EObject> committables)`
`CDOSavepoint`
`setSavepoint()`
Creates a save point in the `CDOTransaction` that can be used to roll back a part of the transaction

### Methods inherited from interface org.eclipse.emf.cdo.common.branch.CDOBranchPoint

`getBranch, getTimeStamp`

### Methods inherited from interface org.eclipse.emf.cdo.common.commit.CDOChangeSetDataProvider

`getChangeSetData`

### Methods inherited from interface org.eclipse.emf.cdo.common.commit.CDOCommitHistory.Provider

`getHistory, getHistory`

### Methods inherited from interface org.eclipse.emf.cdo.common.CDOCommonView

`getDurableLockingID, getLockOwner, getSessionID, getViewID, isDurableView, isHistorical, isReadOnly`

### Methods inherited from interface org.eclipse.emf.cdo.common.revision.CDORevisionProvider

`getRevision`

### Methods inherited from interface org.eclipse.emf.cdo.util.CDOUpdatable

`getLastUpdateTime, runAfterUpdate, waitForUpdate, waitForUpdate`

### Methods inherited from interface org.eclipse.emf.cdo.transaction.CDOUserTransaction

`commit, commit, rollback`

### Methods inherited from interface org.eclipse.emf.cdo.view.CDOView

`addObjectHandler, addRegistrationHandler, compareRevisions, createQuery, createQuery, createResourceURI, disableDurableLocking, enableDurableLocking, enableDurableLocking, getBinaryResource, getLockStates, getLockStates, getLockStatesOfObjects, getObject, getObject, getObject, getObjectHandlers, getObjects, getProvider, getRegistrationHandlers, getResource, getResource, getResourceFolder, getResourceNode, getResourceSet, getRootResource, getSession, getTextResource, getUnitManager, getURIHandler, getViewLock, getViewSet, hasResource, isInvalidating, isInvalidationRunnerActive, isLegacyModeEnabled, isObjectRegistered, lockObjects, lockObjects, queryInstances, queryInstancesAsync, queryInstancesAsync, queryResources, queryResourcesAsync, queryXRefs, queryXRefs, queryXRefsAsync, refreshLockStates, reload, removeObjectHandler, removeRegistrationHandler, setBranch, setBranch, setBranchPoint, setBranchPoint, setBranchPoint, setBranchPoint, setResourcePathCache, setTimeStamp, setTimeStamp, syncExec, syncExec, unlockObjects, unlockObjects, unlockObjects`

### Methods inherited from interface org.eclipse.net4j.util.collection.Closeable

`close, isClosed`

### Methods inherited from interface org.eclipse.core.runtime.IAdaptable

`getAdapter`

### Methods inherited from interface org.eclipse.net4j.util.container.IContainer

`getElements, isEmpty`

### Methods inherited from interface org.eclipse.net4j.util.event.INotifier

`addListener, getListeners, hasListeners, removeListener`

### Methods inherited from interface org.eclipse.net4j.util.properties.IPropertiesContainer

`properties`

## Method Details

### isDirty

boolean isDirty()
Returns `true` if this transaction is not closed and contains uncommitted changes, `false` otherwise.

Specified by:
  `isDirty` in interface `CDOView`
See Also:
  - `isDirty()`

### hasConflict

boolean hasConflict()
Returns `true` if this transaction contains local modifications that are conflicting with remote modifications, `false` otherwise.

Specified by:
  `hasConflict` in interface `CDOView`
See Also:
  - `hasConflict()`

### getConflicts

Set<CDOObject> getConflicts()
Returns the set of objects that are conflicting with remote modifications or an empty set if `hasConflict()` returns `false`.

### revertTo

CDOChangeSetData revertTo(CDOBranchPoint branchPoint)

Since:
  4.15

### merge

CDOChangeSetData merge(CDOBranch source, CDOMerger merger)
Merges the changes from the given source branch into this transaction and possibly considers previous merges from that branch by inspecting the `merge source` information of the `commit history`.

Since:
  4.6
See Also:
  - `merge(CDOBranchPoint, CDOMerger)`

### merge

CDOChangeSetData merge(CDOBranchPoint source, CDOMerger merger)
Merges the changes from the given source point into this transaction and possibly considers previous merges from that `branch` by inspecting the `merge source` information of the `commit history`.

Since:
  3.0

### merge

CDOChangeSetData merge(CDOBranchPoint source, CDOBranchPoint sourceBase, CDOMerger merger)
Merges the changes between the given source base point and the given source point into this transaction.

Warning: If the branch of this transaction already contains merges from the given source point range (i.e., if this merge is a "remerge") this method will likely fail. One of the following methods should be used instead:

- `merge(CDOBranchPoint, CDOBranchPoint, CDOBranchPoint, CDOMerger)`
- `merge(CDOBranchPoint, CDOMerger)`
- `merge(CDOBranch, CDOMerger)`

Since:
  4.0

### merge

CDOChangeSetData merge(CDOBranchPoint source, CDOBranchPoint sourceBase, CDOBranchPoint targetBase, CDOMerger merger)
Merges the changes between the given source base point and the given source point into this transaction.

When specifying an adequate target base point this method is able to perform a proper "remerge".

Since:
  4.6
See Also:
  - `merge(CDOBranchPoint, CDOMerger)`
  - `merge(CDOBranch, CDOMerger)`

### createResourceFolder

CDOResourceFolder createResourceFolder(String path) throws CDOResourceNodeNotFoundException

Throws:
  `CDOResourceNodeNotFoundException`
Since:
  4.0

### getOrCreateResourceFolder

CDOResourceFolder getOrCreateResourceFolder(String path)

Since:
  4.0

### createResource

CDOResource createResource(String path)

See Also:
  - `ResourceSet.createResource(URI)`

### getOrCreateResource

CDOResource getOrCreateResource(String path)

### createTextResource

CDOTextResource createTextResource(String path)

Since:
  4.2

### getOrCreateTextResource

CDOTextResource getOrCreateTextResource(String path)

Since:
  4.2

### createBinaryResource

CDOBinaryResource createBinaryResource(String path)

Since:
  4.2

### getOrCreateBinaryResource

CDOBinaryResource getOrCreateBinaryResource(String path)

Since:
  4.2

### addTransactionHandler

void addTransactionHandler(CDOTransactionHandlerBase handler)

Since:
  4.0

### removeTransactionHandler

void removeTransactionHandler(CDOTransactionHandlerBase handler)

Since:
  4.0

### getTransactionHandlers

CDOTransactionHandler[] getTransactionHandlers()

Since:
  3.0

### getTransactionHandlers1

CDOTransactionHandler1[] getTransactionHandlers1()

Since:
  4.0

### getTransactionHandlers2

CDOTransactionHandler2[] getTransactionHandlers2()

Since:
  4.0

### setSavepoint

CDOSavepoint setSavepoint()
Description copied from interface: `CDOUserTransaction`
Creates a save point in the `CDOTransaction` that can be used to roll back a part of the transaction

Save points do not involve the server side, everything is done on the client side.

Specified by:
  `setSavepoint` in interface `CDOUserTransaction`
Since:
  3.0

### getFirstSavepoint

CDOSavepoint getFirstSavepoint()

Since:
  4.1

### getLastSavepoint

CDOSavepoint getLastSavepoint()

Specified by:
  `getLastSavepoint` in interface `CDOUserTransaction`
Since:
  3.0

### getNewObjects

Map<CDOID,CDOObject> getNewObjects()

### getDetachedObjects

Map<CDOID,CDOObject> getDetachedObjects()

Since:
  2.0

### getDirtyObjects

Map<CDOID,CDOObject> getDirtyObjects()

### getRevisionDeltas

Map<CDOID,CDORevisionDelta> getRevisionDeltas()

### exportChanges

CDOSavepoint[] exportChanges(OutputStream out) throws IOException

Throws:
  `IOException`
Since:
  3.0

### importChanges

CDOSavepoint[] importChanges(InputStream in, boolean reconstructSavepoints) throws IOException

Throws:
  `IOException`
Since:
  3.0

### getLastCommitTime

long getLastCommitTime()

### getCommitComment

String getCommitComment()
Returns the comment to be used in the next commit operation.

Since:
  3.0
See Also:
  - `CDOCommitInfo.getComment()`

### setCommitComment

void setCommitComment(String comment)
Sets the comment to be used in the next commit operation.

Since:
  3.0
See Also:
  - `CDOCommitInfo.getComment()`

### setCommittables

void setCommittables(Set<? extends EObject> committables)

Since:
  4.0

### getCommittables

Set<? extends EObject> getCommittables()

Since:
  4.0

### createQuery

CDOQuery createQuery(String language, String queryString, boolean considerDirtyState)

Since:
  4.0

### createQuery

CDOQuery createQuery(String language, String queryString, Object context, boolean considerDirtyState)

Since:
  4.0

### commit

@Deprecated <T> CDOTransaction.CommitResult<T> commit(Callable<T> callable, org.eclipse.net4j.util.Predicate<Long> retry, IProgressMonitor monitor) throws ConcurrentAccessException, CommitException, Exception
Deprecated.
As of 4.9 use `commit(Callable, java.util.function.Predicate, IProgressMonitor)`.

Throws:
  `ConcurrentAccessException`
  `CommitException`
  `Exception`
Since:
  4.8

### commit

<T> CDOTransaction.CommitResult<T> commit(Callable<T> callable, Predicate<Long> retry, IProgressMonitor monitor) throws ConcurrentAccessException, CommitException, Exception

Throws:
  `ConcurrentAccessException`
  `CommitException`
  `Exception`
Since:
  4.9

### commit

<T> CDOTransaction.CommitResult<T> commit(Callable<T> callable, int attempts, IProgressMonitor monitor) throws ConcurrentAccessException, CommitException, Exception

Throws:
  `ConcurrentAccessException`
  `CommitException`
  `Exception`
Since:
  4.8

### commit

@Deprecated CDOCommitInfo commit(Runnable runnable, org.eclipse.net4j.util.Predicate<Long> retry, IProgressMonitor monitor) throws ConcurrentAccessException, CommitException
Deprecated.
As of 4.9 use `commit(Runnable, java.util.function.Predicate, IProgressMonitor)`.

Throws:
  `ConcurrentAccessException`
  `CommitException`
Since:
  4.8

### commit

CDOCommitInfo commit(Runnable runnable, Predicate<Long> retry, IProgressMonitor monitor) throws ConcurrentAccessException, CommitException

Throws:
  `ConcurrentAccessException`
  `CommitException`
Since:
  4.9

### commit

CDOCommitInfo commit(Runnable runnable, int attempts, IProgressMonitor monitor) throws ConcurrentAccessException, CommitException

Throws:
  `ConcurrentAccessException`
  `CommitException`
Since:
  4.8

### commitAndClose

CDOCommitInfo commitAndClose(IProgressMonitor monitor, boolean keepOpenAfterCommitProblem) throws CommitException

Throws:
  `CommitException`
Since:
  4.21

### options

CDOTransaction.Options options()
Description copied from interface: `CDOCommonView`
Returns the `options` of this view.

Specified by:
  `options` in interface `CDOCommonView`
Specified by:
  `options` in interface `CDOView`
Specified by:
  `options` in interface `org.eclipse.net4j.util.options.IOptionsContainer`