KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > core > TransactionError


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Core License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
// $Id: TransactionError.java,v 1.2 2002/08/27 08:32:25 per_nyfelt Exp $
8

9 package org.ozoneDB.core;
10
11 /**
12  * A TransactionError indicates that the current transaction has to abort no
13  * matter what. (For example because a dead-lock has been detected.) Therefore
14  * it is an Error instead of an Exception. So it will not be catched by a
15  * "catch (Exception e)" clause, which is the common way to catch exceptions in
16  * the ozone code.
17  *
18  *
19  * @author <a HREF="http://www.softwarebuero.de/">SMB</a>
20  * @version $Revision: 1.2 $Date: 2002/08/27 08:32:25 $
21  */

22 public final class TransactionError extends Error JavaDoc {
23
24     public final static int UNKNOWN = 0;
25     public final static int DEADLOCK = 1;
26     public final static int INTERNAL = 2;
27
28     protected int code;
29
30
31     public TransactionError() {
32         super();
33         code = UNKNOWN;
34     }
35
36
37     public TransactionError( String JavaDoc s ) {
38         super( s );
39         code = UNKNOWN;
40     }
41
42
43     public TransactionError( String JavaDoc s, int _code ) {
44         super( s );
45         code = _code;
46     }
47
48
49     public int code() {
50         return code;
51     }
52 }
53
Popular Tags