Class Transaction

    • Field Detail

      • dbType

        protected DBType dbType
      • success

        protected boolean success
      • attempts

        protected int attempts
    • Constructor Detail

      • Transaction

        protected Transaction()
    • Method Detail

      • executeTransaction

        public void executeTransaction​(SQLDB db)
      • 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

        protected <T> T query​(Query<T> query)
      • execute

        protected boolean execute​(Executable executable)
      • execute

        protected boolean execute​(java.lang.String sql)
      • executeSwallowingExceptions

        protected void executeSwallowingExceptions​(java.lang.String... statements)
      • executeOther

        protected void executeOther​(Transaction transaction)
      • getServerUUID

        protected ServerUUID getServerUUID()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • wasSuccessful

        public boolean wasSuccessful()
      • dbIsNotUnderHeavyLoad

        public boolean dbIsNotUnderHeavyLoad()