Class Transaction
java.lang.Object
com.djrapitops.plan.storage.database.transactions.Transaction
- Direct Known Subclasses:
BanStatusTransaction
,CookieChangeTransaction
,CreateIndexTransaction
,GeoInfoStoreTransaction
,OperationCriticalTransaction
,PingStoreTransaction
,PlayerRegisterTransaction
,RegisterWebUserTransaction
,RemoveWebUserTransaction
,SessionEndTransaction
,StoreConfigTransaction
,StoreServerInformationTransaction
,ThrowawayTransaction
,TPSStoreTransaction
,WorldNameStoreTransaction
Represents a database transaction.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
protected boolean
execute(Executable executable)
protected boolean
protected void
executeOther(Transaction transaction)
protected int
executeReturningId(ExecStatement executable)
protected void
executeSwallowingExceptions(String... statements)
void
executeTransaction(SQLDB db)
protected Database.State
protected ServerUUID
protected abstract void
Implement this method for transaction execution.protected <T> T
protected boolean
Override this method for conditional execution.toString()
boolean
-
Field Details
-
dbType
-
success
protected boolean success -
attempts
protected int attempts
-
-
Constructor Details
-
Transaction
protected Transaction()
-
-
Method Details
-
executeTransaction
-
shouldBeExecuted
protected boolean shouldBeExecuted()Override this method for conditional execution.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.
- Returns:
- false if the transaction should not execute.
-
performOperations
protected abstract void performOperations()Implement this method for transaction execution. -
query
-
execute
-
executeReturningId
-
execute
-
executeSwallowingExceptions
-
executeOther
-
getDBState
-
getServerUUID
-
toString
-
wasSuccessful
public boolean wasSuccessful() -
dbIsNotUnderHeavyLoad
public boolean dbIsNotUnderHeavyLoad()
-