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

com.scalar.db.api.TransactionState Maven / Gradle / Ivy

Go to download

A universal transaction manager that achieves database-agnostic transactions and distributed transactions that span multiple databases

There is a newer version: 3.14.0
Show newest version
package com.scalar.db.api;

public enum TransactionState {
  PREPARED(1),
  DELETED(2),
  COMMITTED(3),
  ABORTED(4),
  UNKNOWN(5);

  private final int id;

  TransactionState(final int id) {
    this.id = id;
  }

  public int get() {
    return id;
  }

  public static TransactionState getInstance(int id) {
    for (TransactionState state : TransactionState.values()) {
      if (state.get() == id) {
        return state;
      }
    }
    throw new IllegalArgumentException("invalid id specified.");
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy