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() {
|
||||
client.multi();
|
||||
client.getOne(); // expected OK
|
||||
return new Transaction(client);
|
||||
}
|
||||
|
||||
@@ -1687,6 +1688,7 @@ public class BinaryJedis implements BasicCommands, BinaryJedisCommands, MultiKey
|
||||
jedisTransaction.setClient(client);
|
||||
try {
|
||||
client.multi();
|
||||
client.getOne(); // expected OK
|
||||
jedisTransaction.execute();
|
||||
results = jedisTransaction.exec();
|
||||
} catch (Exception ex) {
|
||||
|
||||
@@ -44,8 +44,6 @@ public class Transaction extends MultiKeyPipelineBase {
|
||||
}
|
||||
|
||||
public List<Object> exec() {
|
||||
// Discard multi
|
||||
consumeResponse(1);
|
||||
// Discard QUEUED or ERROR
|
||||
consumeResponse(getPipelinedResponseLength());
|
||||
|
||||
@@ -67,8 +65,6 @@ public class Transaction extends MultiKeyPipelineBase {
|
||||
}
|
||||
|
||||
public List<Response<?>> execGetResponse() {
|
||||
// Discard multi
|
||||
consumeResponse(1);
|
||||
// Discard QUEUED or ERROR
|
||||
consumeResponse(getPipelinedResponseLength());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user