Package org.eclipse.emf.cdo.transaction

## Interface CDOTransaction.Options

- All Superinterfaces:
    `CDOCommonView.Options`, `CDOView.Options`, `org.eclipse.net4j.util.event.INotifier`, `org.eclipse.net4j.util.options.IOptions`
  Enclosing interface:
    CDOTransaction

      public static interface CDOTransaction.Options
      extends CDOView.Options

  Encapsulates a set of notifying `transaction` configuration options.
  Author:
    Simon McDuff
  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 interface` | `CDOTransaction.Options.AttachedRevisionsMap` | An `options event` fired from transaction `options` when the `attached revisions map` option has changed.
    `static interface` | `CDOTransaction.Options.AutoReleaseLocksEvent` | An `options event` fired from transaction `options` when the `auto release locks enabled` or `auto release locks exemptions` options have changed.
    `static interface` | `CDOTransaction.Options.CommitInfoTimeout` | An `options event` fired from transaction `options` when the `commit info timeout` option has changed.
    `static interface` | `CDOTransaction.Options.ConflictResolversEvent` | An `options event` fired from transaction `options` when the `conflict resolvers` option has changed.
    `static interface` | `CDOTransaction.Options.StaleReferenceCleanerEvent` | An `options event` fired from transaction `options` when the `stale reference cleaner` option has changed.
    `static interface` | `CDOTransaction.Options.UndoDetectorEvent` | An `options event` fired from transaction `options` when the `undo detector` option has changed.

    - ### Nested classes/interfaces inherited from interface org.eclipse.emf.cdo.common.CDOCommonView.Options

      `CDOCommonView.Options.LockNotificationEvent`

    - ### Nested classes/interfaces inherited from interface org.eclipse.emf.cdo.view.CDOView.Options

      `CDOView.Options.CacheReferenceTypeEvent, CDOView.Options.ChangeSubscriptionPoliciesEvent, CDOView.Options.ClearAdapterPolicyEvent, CDOView.Options.DetachmentNotificationEvent, CDOView.Options.FeatureAnalyzerEvent, CDOView.Options.InvalidationNotificationEvent, CDOView.Options.InvalidationPolicyEvent, CDOView.Options.LoadNotificationEvent, CDOView.Options.ReferencePolicyEvent, CDOView.Options.RevisionPrefetchingPolicyEvent, CDOView.Options.StaleReferencePolicyEvent, CDOView.Options.StrongReferencePolicyEvent`

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

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

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static long` | `DEFAULT_COMMIT_INFO_TIMEOUT` |
    `static CDOUndoDetector` | `DEFAULT_UNDO_DETECTOR` |

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

      `DEFAULT_REVISION_PREFETCHING, NO_REVISION_PREFETCHING`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addAutoReleaseLocksExemptions​(boolean recursive, org.eclipse.emf.ecore.EObject... objects)` | Adds the given `object` to the set of objects that are to be treated as exemptions to the `isAutoReleaseLocksEnabled()` option.
    `void` | `addConflictResolver​(CDOConflictResolver resolver)` | Adds a conflict resolver to the list of conflict resolvers of this transaction.
    `void` | `clearAutoReleaseLocksExemptions()` | Clears the set of `objects` that are to be treated as exemptions to the `isAutoReleaseLocksEnabled()` option.
    `java.util.Map<CDOID,​CDORevision>` | `getAttachedRevisionsMap()` | Returns a map which, if non-`null`, stores copies of the initial `revisions` of newly attached objects.
    `java.util.Set<? extends org.eclipse.emf.ecore.EObject>` | `getAutoReleaseLocksExemptions()` | Returns the set of `objects` that are to be treated as exemptions to the `isAutoReleaseLocksEnabled()` option.
    `long` | `getCommitInfoTimeout()` | Returns the number of milliseconds to wait for the transaction update when `CDOUserTransaction.commit()` is called.
    `CDOConflictResolver[]` | `getConflictResolvers()` | Returns a copy of the conflict resolver list of this transaction.
    `CDOTransaction` | `getContainer()` | Returns the `transaction` of this options object.
    `CDOStaleReferenceCleaner` | `getStaleReferenceCleaner()` | Get the `CDOStaleReferenceCleaner` to be used to clean stale references when receiving remote changes on invalidation.
    `CDOUndoDetector` | `getUndoDetector()` | Returns the undo detector of this transaction.
    `boolean` | `isAutoReleaseLocksEnabled()` | Returns `true` if locks in this transaction will be released when `CDOUserTransaction.commit()` or `CDOUserTransaction.rollback()` are called, `false` otherwise.
    `boolean` | `isAutoReleaseLocksExemption​(org.eclipse.emf.ecore.EObject object)` | Returns `true` if the given object is treated as an exemption to the `isAutoReleaseLocksEnabled()` option, `false` otherwise.
    `void` | `removeAutoReleaseLocksExemptions​(boolean recursive, org.eclipse.emf.ecore.EObject... objects)` | Removes the given `object` from the set of objects that are to be treated as exemptions to the `isAutoReleaseLocksEnabled()` option.
    `void` | `removeConflictResolver​(CDOConflictResolver resolver)` | Removes a conflict resolver from the list of conflict resolvers of this transaction.
    `void` | `setAttachedRevisionsMap​(java.util.Map<CDOID,​CDORevision> attachedRevisionsMap)` | Sets a map which, if non-`null`, stores copies of the initial `revisions` of newly attached objects, so that these objects can and will be rolled back to the model values they had at attachment time.
    `void` | `setAutoReleaseLocksEnabled​(boolean on)` | Specifies whether locks in this transaction will be released when `CDOUserTransaction.commit()` or `CDOUserTransaction.rollback()` are called.
    `void` | `setCommitInfoTimeout​(long commitInfoTimeout)` | Specifies the number of milliseconds to wait for the transaction update when `CDOUserTransaction.commit()` is called.
    `void` | `setConflictResolvers​(CDOConflictResolver[] resolvers)` | Sets the conflict resolver list of this transaction.
    `void` | `setStaleReferenceCleaner​(CDOStaleReferenceCleaner staleReferenceCleaner)` | Set the `CDOStaleReferenceCleaner` to be used to clean stale references when receiving remote changes on invalidation.
    `void` | `setUndoDetector​(CDOUndoDetector undoDetector)` | Sets the undo detector of this transaction.

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

      `isLockNotificationEnabled, setLockNotificationEnabled`

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

      `addChangeSubscriptionPolicy, getCacheReferenceType, getChangeSubscriptionPolicies, getClearAdapterPolicy, getFeatureAnalyzer, getInvalidationPolicy, getRevisionPrefetchingPolicy, getStaleReferenceBehaviour, getStaleReferencePolicy, getStrongReferencePolicy, isDetachmentNotificationEnabled, isInvalidationNotificationEnabled, isLoadNotificationEnabled, removeChangeSubscriptionPolicy, setCacheReferenceType, setClearAdapterPolicy, setDetachmentNotificationEnabled, setFeatureAnalyzer, setInvalidationNotificationEnabled, setInvalidationPolicy, setLoadNotificationEnabled, setRevisionPrefetchingPolicy, setStaleReferenceBehaviour, setStaleReferencePolicy, setStrongReferencePolicy`

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

      `addListener, getListeners, hasListeners, removeListener`

- - ### Field Detail

    - #### DEFAULT_UNDO_DETECTOR

          static final CDOUndoDetector DEFAULT_UNDO_DETECTOR

      Since:
        4.3

    - #### DEFAULT_COMMIT_INFO_TIMEOUT

          static final long DEFAULT_COMMIT_INFO_TIMEOUT

      Since:
        4.5
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getContainer

          CDOTransaction getContainer()

      Returns the `transaction` of this options object.
      Specified by:
        `getContainer` in interface `CDOView.Options`
      Specified by:
        `getContainer` in interface `org.eclipse.net4j.util.options.IOptions`
      Since:
        4.0

    - #### getUndoDetector

          CDOUndoDetector getUndoDetector()

      Returns the undo detector of this transaction.
      Since:
        4.3

    - #### setUndoDetector

          void setUndoDetector​(CDOUndoDetector undoDetector)

      Sets the undo detector of this transaction.
      Since:
        4.3

    - #### getConflictResolvers

          CDOConflictResolver[] getConflictResolvers()

      Returns a copy of the conflict resolver list of this transaction.

    - #### setConflictResolvers

          void setConflictResolvers​(CDOConflictResolver[] resolvers)

      Sets the conflict resolver list of this transaction.

    - #### addConflictResolver

          void addConflictResolver​(CDOConflictResolver resolver)

      Adds a conflict resolver to the list of conflict resolvers of this transaction.

    - #### removeConflictResolver

          void removeConflictResolver​(CDOConflictResolver resolver)

      Removes a conflict resolver from the list of conflict resolvers of this transaction.

    - #### getStaleReferenceCleaner

          CDOStaleReferenceCleaner getStaleReferenceCleaner()

      Get the `CDOStaleReferenceCleaner` to be used to clean stale references when receiving remote changes on invalidation.
      Since:
        4.4

    - #### setStaleReferenceCleaner

          void setStaleReferenceCleaner​(CDOStaleReferenceCleaner staleReferenceCleaner)

      Set the `CDOStaleReferenceCleaner` to be used to clean stale references when receiving remote changes on invalidation.
      Since:
        4.4

    - #### isAutoReleaseLocksEnabled

          boolean isAutoReleaseLocksEnabled()

      Returns `true` if locks in this transaction will be released when `CDOUserTransaction.commit()` or `CDOUserTransaction.rollback()` are called, `false` otherwise.

      The default value is `true`.

      See Also:
        `getAutoReleaseLocksExemptions()`

    - #### setAutoReleaseLocksEnabled

          void setAutoReleaseLocksEnabled​(boolean on)

      Specifies whether locks in this transaction will be released when `CDOUserTransaction.commit()` or `CDOUserTransaction.rollback()` are called.

      If set to `false` all locks will be kept when `CDOUserTransaction.commit()` or `CDOUserTransaction.rollback()` are called.

      The default value is `true`.

      See Also:
        `getAutoReleaseLocksExemptions()`

    - #### getAutoReleaseLocksExemptions

          java.util.Set<? extends org.eclipse.emf.ecore.EObject> getAutoReleaseLocksExemptions()

      Returns the set of `objects` that are to be treated as exemptions to the `isAutoReleaseLocksEnabled()` option.

      That means:

      - If `isAutoReleaseLocksEnabled()` returns `true`, the locks on the objects in this set are not released when `CDOUserTransaction.commit()` or `CDOUserTransaction.rollback()` are called.
      - If `isAutoReleaseLocksEnabled()` returns `false`, the locks on the objects in this set are released nevertheless when `CDOUserTransaction.commit()` or `CDOUserTransaction.rollback()` are called.

      The returned set is unmodifiable. To modify the set use the `clearAutoReleaseLocksExemptions()`, `addAutoReleaseLocksExemption()`, and `removeAutoReleaseLocksExemption()` methods.

      Implementation note: This set stores weak references to the contained objects.

      Since:
        4.6
      See Also:
        `clearAutoReleaseLocksExemptions()`, `addAutoReleaseLocksExemptions(boolean, EObject...)`, `removeAutoReleaseLocksExemptions(boolean, EObject...)`

    - #### isAutoReleaseLocksExemption

          boolean isAutoReleaseLocksExemption​(org.eclipse.emf.ecore.EObject object)

      Returns `true` if the given object is treated as an exemption to the `isAutoReleaseLocksEnabled()` option, `false` otherwise.
      Since:
        4.6
      See Also:
        `getAutoReleaseLocksExemptions()`

    - #### clearAutoReleaseLocksExemptions

          void clearAutoReleaseLocksExemptions()

      Clears the set of `objects` that are to be treated as exemptions to the `isAutoReleaseLocksEnabled()` option.
      Since:
        4.6
      See Also:
        `getAutoReleaseLocksExemptions()`, `addAutoReleaseLocksExemptions(boolean, EObject...)`, `removeAutoReleaseLocksExemptions(boolean, EObject...)`

    - #### addAutoReleaseLocksExemptions

          void addAutoReleaseLocksExemptions​(boolean recursive,
                                             org.eclipse.emf.ecore.EObject... objects)

      Adds the given `object` to the set of objects that are to be treated as exemptions to the `isAutoReleaseLocksEnabled()` option.
      Since:
        4.6
      See Also:
        `getAutoReleaseLocksExemptions()`, `clearAutoReleaseLocksExemptions()`, `removeAutoReleaseLocksExemptions(boolean, EObject...)`

    - #### removeAutoReleaseLocksExemptions

          void removeAutoReleaseLocksExemptions​(boolean recursive,
                                                org.eclipse.emf.ecore.EObject... objects)

      Removes the given `object` from the set of objects that are to be treated as exemptions to the `isAutoReleaseLocksEnabled()` option.
      Since:
        4.6
      See Also:
        `getAutoReleaseLocksExemptions()`, `clearAutoReleaseLocksExemptions()`, `addAutoReleaseLocksExemptions(boolean, EObject...)`

    - #### getAttachedRevisionsMap

          java.util.Map<CDOID,​CDORevision> getAttachedRevisionsMap()

      Returns a map which, if non-`null`, stores copies of the initial `revisions` of newly attached objects.
      Since:
        4.8
      See Also:
        `setAttachedRevisionsMap(Map)`

    - #### setAttachedRevisionsMap

          void setAttachedRevisionsMap​(java.util.Map<CDOID,​CDORevision> attachedRevisionsMap)

      Sets a map which, if non-`null`, stores copies of the initial `revisions` of newly attached objects, so that these objects can and will be rolled back to the model values they had at attachment time. If this map is `null` newly attached objects will keep the model values they have at rollback time. Note that remembering copies of all newly attached objects can impose resource problems when many objects are attached, e.g., during larger imports.
      Since:
        4.8

    - #### getCommitInfoTimeout

          long getCommitInfoTimeout()

      Returns the number of milliseconds to wait for the transaction update when `CDOUserTransaction.commit()` is called.

      Default value is 10000.

      Since:
        4.5

    - #### setCommitInfoTimeout

          void setCommitInfoTimeout​(long commitInfoTimeout)

      Specifies the number of milliseconds to wait for the transaction update when `CDOUserTransaction.commit()` is called.

      Default value is 10000.

      Since:
        4.5