01: // You can redistribute this software and/or modify it under the terms of
02: // the Ozone Core License version 1 published by ozone-db.org.
03: //
04: // The original code and portions created by SMB are
05: // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
06: //
07: // $Id: TransactionError.java,v 1.1 2001/12/18 10:31:30 per_nyfelt Exp $
08:
09: 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.1 $Date: 2001/12/18 10:31:30 $
21: */
22: public final class TransactionError extends Error {
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: public TransactionError() {
31: super ();
32: code = UNKNOWN;
33: }
34:
35: public TransactionError(String s) {
36: super (s);
37: code = UNKNOWN;
38: }
39:
40: public TransactionError(String s, int _code) {
41: super (s);
42: code = _code;
43: }
44:
45: public int code() {
46: return code;
47: }
48: }
|