01: // You can redistribute this software and/or modify it under the terms of
02: // the Ozone Library 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: TransactionExc.java,v 1.1 2001/12/18 10:31:30 per_nyfelt Exp $
08:
09: package org.ozoneDB;
10:
11: /**
12: * This exception is thrown, if...
13: *
14: *
15: * @author <a href="http://www.softwarebuero.de/">SMB</a>
16: * @version $Revision: 1.1 $Date: 2001/12/18 10:31:30 $
17: */
18: public class TransactionExc extends OzoneRemoteExc {
19:
20: public final static int UNKNOWN = 0;
21:
22: /**
23: * Transaction had inproper status to complete the requested operation.
24: */
25: public final static int STATE = 1;
26:
27: /**
28: * Transaction was rolled back instead of prepared.
29: */
30: public final static int ROLLBACK = 2;
31:
32: /**
33: * An object that was optimisticly locked (by an explicit lock or the use of
34: * {@link ClientCacheDatabase}) was changed by another party.
35: */
36: public final static int OPTIMISTIC = 3;
37:
38: /**
39: * An error was encountered where it was not expected. This normaly
40: * indicates a runtime exception (for example an IOException) or a bug.
41: */
42: public final static int UNEXPECTED = 4;
43:
44: /**
45: * The transaction was stopped by the transaction manager.
46: */
47: public final static int STOPPED = 5;
48:
49: protected int code;
50:
51: public TransactionExc() {
52: }
53:
54: public TransactionExc(String s) {
55: super (s);
56: code = UNKNOWN;
57: }
58:
59: public TransactionExc(String s, int _code) {
60: super (s);
61: code = _code;
62: }
63:
64: public int code() {
65: return code;
66: }
67:
68: public String toString() {
69: return super .toString() + " [code: " + code + "]";
70: }
71: }
|