@@ -62,6 +62,7 @@ public Transaction(Connection connection, boolean doMulti) {
6262 this (connection , new CommandObjects (), doMulti , false );
6363 }
6464
65+
6566 /**
6667 * Creates a new transaction.
6768 *
@@ -72,6 +73,21 @@ public Transaction(Connection connection, boolean doMulti) {
7273 * @param doMulti {@code false} should be set to enable manual WATCH, UNWATCH and MULTI
7374 * @param closeConnection should the 'connection' be closed when 'close()' is called?
7475 */
76+ public Transaction (Connection connection , boolean doMulti , boolean closeConnection ) {
77+ this (connection , new CommandObjects (), doMulti , closeConnection );
78+ }
79+
80+ /**
81+ * Creates a new transaction.
82+ *
83+ * A user wanting to WATCH/UNWATCH keys followed by a call to MULTI ({@link #multi()}) it should
84+ * be {@code doMulti=false}.
85+ *
86+ * @param connection connection
87+ * @param commandObjects commandObjects
88+ * @param doMulti {@code false} should be set to enable manual WATCH, UNWATCH and MULTI
89+ * @param closeConnection should the 'connection' be closed when 'close()' is called?
90+ */
7591 public Transaction (Connection connection , CommandObjects commandObjects , boolean doMulti , boolean closeConnection ) {
7692 super (commandObjects );
7793 this .connection = connection ;
@@ -91,16 +107,14 @@ public final void multi() {
91107
92108 @ Override
93109 public String watch (final String ... keys ) {
94- connection .sendCommand (commandObjects .watch (keys ).getArguments ());
95- String status = connection .getStatusCodeReply ();
110+ String status = connection .executeCommand (commandObjects .watch (keys ));
96111 inWatch = true ;
97112 return status ;
98113 }
99114
100115 @ Override
101116 public String watch (final byte []... keys ) {
102- connection .sendCommand (commandObjects .watch (keys ).getArguments ());
103- String status = connection .getStatusCodeReply ();
117+ String status = connection .executeCommand (commandObjects .watch (keys ));
104118 inWatch = true ;
105119 return status ;
106120 }
0 commit comments