01: package org.apache.ojb.odmg;
02:
03: /* Copyright 2002-2005 The Apache Software Foundation
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: import javax.transaction.Status;
19:
20: public class TxUtil {
21: public static String getStatusString(int status) {
22: switch (status) {
23: case Status.STATUS_ACTIVE:
24: return "STATUS_ACTIVE";
25: case Status.STATUS_COMMITTED:
26: return "STATUS_COMMITTED";
27: case Status.STATUS_COMMITTING:
28: return "STATUS_COMMITTING";
29: case Status.STATUS_MARKED_ROLLBACK:
30: return "STATUS_MARKED_ROLLBACK";
31: case Status.STATUS_NO_TRANSACTION:
32: return "STATUS_NO_TRANSACTION";
33: case Status.STATUS_PREPARED:
34: return "STATUS_PREPARED";
35: case Status.STATUS_PREPARING:
36: return "STATUS_PREPARING";
37: case Status.STATUS_ROLLEDBACK:
38: return "STATUS_ROLLEDBACK";
39: case Status.STATUS_ROLLING_BACK:
40: return "STATUS_ROLLING_BACK";
41: case Status.STATUS_UNKNOWN:
42: return "STATUS_UNKNOWN";
43: default:
44: return "NO STATUS FOUND";
45: }
46: }
47: }
|