001 package org.apache.ojb.odmg;
002
003 /* Copyright 2002-2005 The Apache Software Foundation
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018 import javax.transaction.Status;
019
020 public class TxUtil
021 {
022 public static String getStatusString(int status)
023 {
024 switch (status)
025 {
026 case Status.STATUS_ACTIVE:
027 return "STATUS_ACTIVE";
028 case Status.STATUS_COMMITTED:
029 return "STATUS_COMMITTED";
030 case Status.STATUS_COMMITTING:
031 return "STATUS_COMMITTING";
032 case Status.STATUS_MARKED_ROLLBACK:
033 return "STATUS_MARKED_ROLLBACK";
034 case Status.STATUS_NO_TRANSACTION:
035 return "STATUS_NO_TRANSACTION";
036 case Status.STATUS_PREPARED:
037 return "STATUS_PREPARED";
038 case Status.STATUS_PREPARING:
039 return "STATUS_PREPARING";
040 case Status.STATUS_ROLLEDBACK:
041 return "STATUS_ROLLEDBACK";
042 case Status.STATUS_ROLLING_BACK:
043 return "STATUS_ROLLING_BACK";
044 case Status.STATUS_UNKNOWN:
045 return "STATUS_UNKNOWN";
046 default:
047 return "NO STATUS FOUND";
048 }
049 }
050 }