org.eclipse.emf.cdo.transaction

## Interface CDOTransactionHandler1

- All Superinterfaces:
    CDOTransactionHandlerBase
  All Known Subinterfaces:
    CDOTransactionHandler, CDOTransactionHandler1.WithUndo
  All Known Implementing Classes:
    CDOAsyncTransactionHandler, CDOAutoAttacher, CDOAutoLocker, CDOAutoLocker.ForSingleValuedChanges, CDODefaultTransactionHandler, CDODefaultTransactionHandler1, CDOPostEventTransactionHandler, CDOPostEventTransactionHandler.Default

      public interface CDOTransactionHandler1
      extends CDOTransactionHandlerBase

  A call-back interface that is called by a `transaction` before `objects` are attached, modified or detached.
  Since:
    4.0
  Author:
    Eike Stepper
  See Also:
    `CDOPostEventTransactionHandler`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `CDOTransactionHandler1.WithUndo`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `attachingObject(CDOTransaction transaction, CDOObject object)` Called by a `CDOTransaction` before an object is added.
    `void` | `detachingObject(CDOTransaction transaction, CDOObject object)` Called by a `CDOTransaction` before an object is detached.
    `void` | `modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)` Called by a `CDOTransaction` before an object is modified.

- - ### Method Detail

    - #### attachingObject

          void attachingObject(CDOTransaction transaction,
                               CDOObject object)

      Called by a `CDOTransaction` before an object is added. The implementor of this method is allowed to throw an unchecked exception that will propagate up to the operation that is about to add the object (thereby preventing the operation from successful completion).

      Note: Implementors must not start threads which access the `view` and wait for their completion since deadlocks can result. The following example causes a deadlock:

           getDisplay().syncExec(new Runnable()
           {
             public void run()
             {
               try
               {
                 cdoObject.getName();
               }
               catch (Exception ignore)
               {
               }
             }
           });

      If you need to synchronously execute threads which access the `view` you should use `CDOAsyncTransactionHandler`.

    - #### detachingObject

          void detachingObject(CDOTransaction transaction,
                               CDOObject object)

      Called by a `CDOTransaction` before an object is detached. The implementor of this method is allowed to throw an unchecked exception that will propagate up to the operation that is about to remove the object (thereby preventing the operation from completing successfully).

      Note: Implementors must not start threads which access the `view` and wait for their completion since deadlocks can result. The following example causes a deadlock:

           getDisplay().syncExec(new Runnable()
           {
             public void run()
             {
               try
               {
                 cdoObject.getName();
               }
               catch (Exception ignore)
               {
               }
             }
           });

      If you need to synchronously execute threads which access the `view` you should use `CDOAsyncTransactionHandler`.

    - #### modifyingObject

          void modifyingObject(CDOTransaction transaction,
                               CDOObject object,
                               CDOFeatureDelta featureDelta)

      Called by a `CDOTransaction` before an object is modified. The implementor of this method is allowed to throw an unchecked exception that will propagate up to the operation that is about to modify the object (thereby preventing the operation from completing successfully).

      Note: Implementors must not start threads which access the `view` and wait for their completion since deadlocks can result. The following example causes a deadlock:

           getDisplay().syncExec(new Runnable()
           {
             public void run()
             {
               try
               {
                 cdoObject.getName();
               }
               catch (Exception ignore)
               {
               }
             }
           });

      If you need to synchronously execute threads which access the `view` you should use `CDOAsyncTransactionHandler`.

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