2 * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.mdsal.common.api;
11 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
12 import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
16 * Failure of asynchronous transaction commit caused by failure
17 * of optimistic locking.
19 * This exception is raised and returned when transaction commit
20 * failed, because other transaction finished successfully
21 * and modified same data as failed transaction.
23 * Clients may recover from this error condition by
24 * retrieving current state and submitting new updated
28 public class OptimisticLockFailedException extends TransactionCommitFailedException {
30 private static final long serialVersionUID = 1L;
32 public OptimisticLockFailedException(final String message, final Throwable cause) {
33 super(message, cause, RpcResultBuilder.newError(ErrorType.APPLICATION, "resource-denied",
34 message, null, null, cause));
37 public OptimisticLockFailedException(final String message) {