org.eclipse.emf.cdo.transaction

## Interface CDOTransaction

- All Superinterfaces:
    CDOBranchPoint, CDOBranchProvider, CDOChangeSetDataProvider, CDOCommitHistory.Provider<CDOObject,CDOObjectHistory>, CDOCommonTransaction, CDOCommonView, CDOLockOwner, CDORevisionProvider, CDOTimeProvider, CDOUpdatable, CDOUserTransaction, CDOView, Closeable, IAdaptable, IContainer<CDOResourceNode>, INotifier, IOptionsContainer, 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 and Description
    --- | ---
    `static interface` | `CDOTransaction.Options` Encapsulates a set of notifying `transaction` configuration options.

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

      `IContainer.Modifiable<E>, IContainer.Persistable<E>, IContainer.Persistence<E>`

  - ### Field Summary

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

      `PROP_TIME_MACHINE_DISABLED`

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

      `NO_TIMEOUT`

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

      `INVALID_DATE, UNSPECIFIED_DATE`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addTransactionHandler(CDOTransactionHandlerBase handler)`
    `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(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`.
    `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`.
    `CDOTransaction.Options` | `options()` Returns the `options` of this view.
    `void` | `removeTransactionHandler(CDOTransactionHandlerBase handler)`
    `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.view.CDOView

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

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

      `getLastUpdateTime, runAfterUpdate, waitForUpdate, waitForUpdate`

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

      `getHistory, getHistory`

    - ### 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.emf.cdo.common.CDOCommonView

      `getDurableLockingID, getViewID, isHistorical, isReadOnly`

    - ### Methods inherited from interface org.eclipse.emf.cdo.common.lock.CDOLockOwner

      `getSessionID, isDurableView`

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

      `getBranch, getTimeStamp`

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

      `getRevision`

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

      `properties`

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

      `getAdapter`

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

      `close, isClosed`

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

      `commit, commit, rollback`

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

      `getChangeSetData`

- - ### Method Detail

    - #### 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`.

    - #### 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)

      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

    - #### 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 `IOptionsContainer`

Copyright (c) 2014 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