KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mckoi > database > TransactionException


1 /**
2  * com.mckoi.database.TransactionException 22 Nov 2000
3  *
4  * Mckoi SQL Database ( http://www.mckoi.com/database )
5  * Copyright (C) 2000, 2001, 2002 Diehl and Associates, Inc.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * Version 2 as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License Version 2 for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * Version 2 along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19  *
20  * Change Log:
21  *
22  *
23  */

24
25 package com.mckoi.database;
26
27 /**
28  * Thrown when a transaction error happens. This can only be thrown during
29  * the commit process of a transaction.
30  *
31  * @author Tobias Downer
32  */

33
34 public class TransactionException extends Exception JavaDoc {
35
36   // The types of transaction exceptions.
37

38   /**
39    * Thrown when a transaction deletes or updates a row that another
40    * transaction has committed a change to.
41    */

42   public final static int ROW_REMOVE_CLASH = 1;
43
44   /**
45    * Thrown when a transaction drops or alters a table that another transaction
46    * has committed a change to.
47    */

48   public final static int TABLE_REMOVE_CLASH = 2;
49
50   /**
51    * Thrown when a transaction adds/removes/modifies rows from a table that
52    * has been dropped by another transaction.
53    */

54   public final static int TABLE_DROPPED = 3;
55
56   /**
57    * Thrown when a transaction selects data from a table that has committed
58    * changes to it from another transaction.
59    */

60   public final static int DIRTY_TABLE_SELECT = 4;
61
62   /**
63    * Thrown when a transaction conflict occurs and would cause duplicate tables
64    * to be created.
65    */

66   public final static int DUPLICATE_TABLE = 5;
67
68
69
70   /**
71    * The type of error.
72    */

73   private int type;
74
75   public TransactionException(int type, String JavaDoc message) {
76     super(message);
77     this.type = type;
78   }
79
80   /**
81    * Returns the type of transaction error this is.
82    */

83   public int getType() {
84     return type;
85   }
86
87
88 }
89
Popular Tags