org.eclipse.emf.cdo.util

## Class CommitException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - org.eclipse.emf.cdo.util.CommitException

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    ConcurrentAccessException, DataIntegrityException

      public class CommitException
      extends java.lang.Exception

  A checked exception being thrown from `CDOUserTransaction.commit()` in case of commit problems such as commit conflicts.

  This class is the root of an exception hierarchy that allows to determine and handle specific causes of commit problems:

          CDOTransaction transaction = session.openTransaction();

          for (;;)
          {
            transaction.getViewLock().lock();

            try
            {
              CDOResource resource = transaction.getResource("/stock/resource1");

              // Modify the model here...

              transaction.commit();
              break;
            }
            catch (ConcurrentAccessException ex)
            {
              transaction.rollback();
            }
            catch (CommitException ex)
            {
              throw ex.wrap();
            }
            finally
            {
              transaction.getViewLock().unlock();
            }
          }

  Instances of this class indicate low-level technical problems such as database or network issues.
  Since:
    3.0
  Author:
    Eike Stepper
  See Also:
    Serialized Form
  No Extend
    This interface is not intended to be extended by clients.
  No Instantiate
    This class is not intended to be instantiated by clients.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CommitException()`
    `CommitException(java.lang.String message)`
    `CommitException(java.lang.String message, java.lang.Throwable cause)`
    `CommitException(java.lang.Throwable cause)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isLocal()`
    `TransactionException` | `wrap()`

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### CommitException

          public CommitException()

    - #### CommitException

          public CommitException(java.lang.String message)

    - #### CommitException

          public CommitException(java.lang.Throwable cause)

    - #### CommitException

          public CommitException(java.lang.String message,
                                 java.lang.Throwable cause)

  - ### Method Detail

    - #### isLocal

          public boolean isLocal()

      Since:
        4.2

    - #### wrap

          public TransactionException wrap()

      Since:
        4.2

Copyright (c) 2004-2019 Eike Stepper (Loehne, 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