Class TransactionSaver

java.lang.Object
org.mariadb.jdbc.client.impl.TransactionSaver

public class TransactionSaver extends Object
Transaction cache Huge command are not cached, cache is limited to configuration transactionReplaySize commands
  • Field Details

    • buffers

      private final RedoableClientMessage[] buffers
    • idx

      private int idx
    • dirty

      private boolean dirty
  • Constructor Details

    • TransactionSaver

      public TransactionSaver(int transactionReplaySize)
      Constructor
      Parameters:
      transactionReplaySize - maximum number of command cached
  • Method Details

    • add

      public void add(RedoableClientMessage clientMessage)
      Add a command to cache.
      Parameters:
      clientMessage - client message
    • clear

      public void clear()
      Transaction finished, clearing cache
    • getIdx

      public int getIdx()
      Current transaction cache length
      Returns:
      cache length
    • isDirty

      public boolean isDirty()
      Is cache not valid (some commands have not been cached)
      Returns:
      is dirty
    • getBuffers

      public RedoableClientMessage[] getBuffers()
      cache buffer
      Returns:
      cached messages