public abstract class Transaction
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
attempts |
protected DBType |
dbType |
protected boolean |
success |
Modifier | Constructor and Description |
---|---|
protected |
Transaction() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
execute(Executable executable) |
protected boolean |
execute(java.lang.String sql) |
protected void |
executeOther(Transaction transaction) |
protected void |
executeSwallowingExceptions(java.lang.String... statements) |
void |
executeTransaction(SQLDB db) |
protected Database.State |
getDBState() |
protected java.util.UUID |
getServerUUID() |
protected abstract void |
performOperations()
Implement this method for transaction execution.
|
protected <T> T |
query(Query<T> query) |
protected boolean |
shouldBeExecuted()
Override this method for conditional execution.
|
java.lang.String |
toString() |
boolean |
wasSuccessful() |
protected DBType dbType
protected boolean success
protected int attempts
public void executeTransaction(SQLDB db)
protected boolean shouldBeExecuted()
Please note that the transaction has not been initialized and class variables are not available for queries. The condition should depend on other variables (Like the data that is to be stored) given to the transaction.
protected abstract void performOperations()
protected <T> T query(Query<T> query)
protected boolean execute(Executable executable)
protected boolean execute(java.lang.String sql)
protected void executeSwallowingExceptions(java.lang.String... statements)
protected void executeOther(Transaction transaction)
protected Database.State getDBState()
protected java.util.UUID getServerUUID()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean wasSuccessful()