Let BinaryJedis.multi() consumes "OK" message
* Transaction doesn't have to consume "multi"'s response
This commit is contained in:
@@ -1679,6 +1679,7 @@ public class BinaryJedis implements BasicCommands, BinaryJedisCommands, MultiKey
|
|||||||
|
|
||||||
public Transaction multi() {
|
public Transaction multi() {
|
||||||
client.multi();
|
client.multi();
|
||||||
|
client.getOne(); // expected OK
|
||||||
return new Transaction(client);
|
return new Transaction(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1687,6 +1688,7 @@ public class BinaryJedis implements BasicCommands, BinaryJedisCommands, MultiKey
|
|||||||
jedisTransaction.setClient(client);
|
jedisTransaction.setClient(client);
|
||||||
try {
|
try {
|
||||||
client.multi();
|
client.multi();
|
||||||
|
client.getOne(); // expected OK
|
||||||
jedisTransaction.execute();
|
jedisTransaction.execute();
|
||||||
results = jedisTransaction.exec();
|
results = jedisTransaction.exec();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|||||||
@@ -44,8 +44,6 @@ public class Transaction extends MultiKeyPipelineBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<Object> exec() {
|
public List<Object> exec() {
|
||||||
// Discard multi
|
|
||||||
consumeResponse(1);
|
|
||||||
// Discard QUEUED or ERROR
|
// Discard QUEUED or ERROR
|
||||||
consumeResponse(getPipelinedResponseLength());
|
consumeResponse(getPipelinedResponseLength());
|
||||||
|
|
||||||
@@ -67,8 +65,6 @@ public class Transaction extends MultiKeyPipelineBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<Response<?>> execGetResponse() {
|
public List<Response<?>> execGetResponse() {
|
||||||
// Discard multi
|
|
||||||
consumeResponse(1);
|
|
||||||
// Discard QUEUED or ERROR
|
// Discard QUEUED or ERROR
|
||||||
consumeResponse(getPipelinedResponseLength());
|
consumeResponse(getPipelinedResponseLength());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user