Class Transaction

All Implemented Interfaces:
Closeable, AutoCloseable, BloomFilterPipelineCommands, CountMinSketchPipelineCommands, CuckooFilterPipelineCommands, RedisBloomPipelineCommands, TDigestSketchPipelineCommands, TopKFilterPipelineCommands, BitPipelineBinaryCommands, BitPipelineCommands, FunctionPipelineBinaryCommands, FunctionPipelineCommands, GeoPipelineBinaryCommands, GeoPipelineCommands, HashPipelineBinaryCommands, HashPipelineCommands, HyperLogLogPipelineBinaryCommands, HyperLogLogPipelineCommands, KeyPipelineBinaryCommands, KeyPipelineCommands, ListPipelineBinaryCommands, ListPipelineCommands, PipelineBinaryCommands, PipelineCommands, RedisModulePipelineCommands, SampleBinaryKeyedPipelineCommands, SampleKeyedPipelineCommands, ScriptingKeyPipelineBinaryCommands, ScriptingKeyPipelineCommands, SetPipelineBinaryCommands, SetPipelineCommands, SortedSetPipelineBinaryCommands, SortedSetPipelineCommands, StreamPipelineBinaryCommands, StreamPipelineCommands, StringPipelineBinaryCommands, StringPipelineCommands, RedisGraphPipelineCommands, RedisJsonPipelineCommands, RediSearchPipelineCommands, RedisTimeSeriesPipelineCommands

public class Transaction extends TransactionBase
A pipeline based transaction.
  • Field Details

    • jedis

      private final Jedis jedis
  • Constructor Details

    • Transaction

      public Transaction(Jedis jedis)
    • Transaction

      public Transaction(Connection connection)
      Creates a new transaction. A MULTI command will be added to be sent to server. WATCH/UNWATCH/MULTI commands must not be called with this object.
      Parameters:
      connection - connection
    • Transaction

      public Transaction(Connection connection, boolean doMulti)
      Creates a new transaction. A user wanting to WATCH/UNWATCH keys followed by a call to MULTI (TransactionBase.multi()) it should be doMulti=false.
      Parameters:
      connection - connection
      doMulti - false should be set to enable manual WATCH, UNWATCH and MULTI
    • Transaction

      public Transaction(Connection connection, boolean doMulti, boolean closeConnection)
      Creates a new transaction. A user wanting to WATCH/UNWATCH keys followed by a call to MULTI (TransactionBase.multi()) it should be doMulti=false.
      Parameters:
      connection - connection
      doMulti - false should be set to enable manual WATCH, UNWATCH and MULTI
      closeConnection - should the 'connection' be closed when 'close()' is called?
  • Method Details