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
8 package org.opendaylight.mdsal.common.api;
10 import org.opendaylight.yangtools.yang.common.ErrorTag;
11 import org.opendaylight.yangtools.yang.common.ErrorType;
12 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
15 * Failure of asynchronous transaction commit caused by failure of optimistic locking. This exception is raised and
16 * returned when transaction commit failed, because other transaction finished successfully and modified same data as
17 * failed transaction. Clients may recover from this error condition by retrieving current state and submitting a new
18 * updated transaction.
20 public class OptimisticLockFailedException extends TransactionCommitFailedException {
21 private static final long serialVersionUID = 1L;
23 public OptimisticLockFailedException(final String message, final Throwable cause) {
25 RpcResultBuilder.newError(ErrorType.APPLICATION, ErrorTag.RESOURCE_DENIED, message, null, null, cause));
28 public OptimisticLockFailedException(final String message) {