All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.commons.tx.Util Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev03
Show newest version
package org.infinispan.commons.tx;

import jakarta.transaction.Status;

/**
 * Transaction related util class.
 *
 * @author Pedro Ruivo
 * @since 9.2
 */
public class Util {

   private Util() {
   }

   public static String transactionStatusToString(int status) {
      switch (status) {
         case Status.STATUS_ACTIVE:
            return "ACTIVE";
         case Status.STATUS_MARKED_ROLLBACK:
            return "MARKED_ROLLBACK";
         case Status.STATUS_PREPARED:
            return "PREPARED";
         case Status.STATUS_COMMITTED:
            return "COMMITTED";
         case Status.STATUS_ROLLEDBACK:
            return "ROLLED_BACK";
         case Status.STATUS_UNKNOWN:
            return "UNKNOWN";
         case Status.STATUS_NO_TRANSACTION:
            return "NO_TRANSACTION";
         case Status.STATUS_PREPARING:
            return "PREPARING";
         case Status.STATUS_COMMITTING:
            return "COMMITTING";
         case Status.STATUS_ROLLING_BACK:
            return "ROLLING_BACK";
         default:
            return "unknown status (" + status + ")";
      }
   }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy