Class Transaction
java.lang.Object
com.djrapitops.plan.storage.database.transactions.Transaction
- Direct Known Subclasses:
BanStatusTransaction
,ChangeUserUUIDTransaction
,CookieChangeTransaction
,CreateIndexTransaction
,DeleteWebGroupTransaction
,GrantWebPermissionToGroupsWithPermissionTransaction
,OperationCriticalTransaction
,PingStoreTransaction
,PlayerRegisterTransaction
,RemoveWebUserTransaction
,ShutdownDataPreservationTransaction
,StoreConfigTransaction
,StoreGeoInfoTransaction
,StoreJoinAddressTransaction
,StoreMissingWebPermissionsTransaction
,StorePluginVersionsTransaction
,StoreServerInformationTransaction
,StoreSessionTransaction
,StoreWebGroupTransaction
,StoreWebUserPreferencesTransaction
,StoreWebUserTransaction
,StoreWorldNameTransaction
,ThrowawayTransaction
,TPSStoreTransaction
Represents a database transaction.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
boolean
protected boolean
execute
(Executable executable) protected boolean
protected void
executeOther
(Transaction transaction) protected int
executeReturningId
(ExecStatement executable) protected void
executeSwallowingExceptions
(String... statements) void
protected Database.State
getName()
protected ServerUUID
protected boolean
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
-
commitMidTransaction
protected void commitMidTransaction() -
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() -
getName
-
hasTable
-