001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.commons.transaction.file; 018 019/** 020 * Error codes for resource managers. 021 * 022 * @version $Id: ResourceManagerErrorCodes.java 493628 2007-01-07 01:42:48Z joerg $ 023 * @see ResourceManager 024 * @see ResourceManagerException 025 * @see ResourceManagerSystemException 026 */ 027public interface ResourceManagerErrorCodes { 028 029 /** 030 * Error code: unknown error 031 */ 032 public static final int ERR_UNKNOWN = -1; 033 034 /** 035 * Error code: general system error 036 */ 037 public static final int ERR_SYSTEM = 1; 038 039 /** 040 * Error code: global inconsistent data system error 041 */ 042 public static final int ERR_SYSTEM_INCONSISTENT = ERR_SYSTEM + 1; 043 044 /** 045 * Error code: inconsistent transaction data system error 046 */ 047 public static final int ERR_TX_INCONSISTENT = ERR_SYSTEM + 2; 048 049 /** 050 * Error code: no transaction error 051 */ 052 public static final int ERR_NO_TX = 1000; 053 054 /** 055 * Error code: transaction identifier invalid error 056 */ 057 public static final int ERR_TXID_INVALID = ERR_NO_TX + 1; 058 059 /** 060 * Error code: transaction inactive error 061 */ 062 public static final int ERR_TX_INACTIVE = ERR_NO_TX + 2; 063 064 /** 065 * Error code: transaction identifier already exists error 066 */ 067 public static final int ERR_DUP_TX = ERR_NO_TX + 4; 068 069 /** 070 * Error code: calling thread is not owner of transaction error (only in single thread implementations) 071 */ 072 public static final int ERR_THREAD_INVALID = ERR_NO_TX + 5; 073 074 /** 075 * Error code: requested isolation level is not supported for this transaction error 076 */ 077 public static final int ERR_ISOLATION_LEVEL_UNSUPPORTED = ERR_NO_TX + 6; 078 079 /** 080 * Error code: operation not possible as transaction is alredy marked for rollback error 081 */ 082 public static final int ERR_MARKED_FOR_ROLLBACK = ERR_NO_TX + 7; 083 084 /** 085 * Error code: resource identifier invalid error 086 */ 087 public static final int ERR_RESOURCEID_INVALID = 4000; 088 089 /** 090 * Error code: resource already exists error 091 */ 092 public static final int ERR_RESOURCE_EXISTS = ERR_RESOURCEID_INVALID + 1; 093 094 /** 095 * Error code: resource does not exist error 096 */ 097 public static final int ERR_NO_SUCH_RESOURCE = ERR_RESOURCEID_INVALID + 2; 098 099 /** 100 * Error code: general lock error 101 */ 102 public static final int ERR_LOCK = 5000; 103 104 /** 105 * Error code: lock could not be acquired error 106 */ 107 public static final int ERR_NO_LOCK = ERR_LOCK + 1; 108 109 /** 110 * Error code: lock could not be acquired error 111 */ 112 public static final int ERR_DEAD_LOCK = ERR_LOCK + 2; 113 114 115}