Throw UnsupportedOpException on watch in tx in Lettuce

DATAREDIS-225
This commit is contained in:
Jennifer Hickey
2013-07-22 12:32:37 -07:00
parent 5ab5ee031e
commit 86173faa81
2 changed files with 9 additions and 2 deletions

View File

@@ -826,13 +826,15 @@ public class LettuceConnection implements RedisConnection {
}
public void watch(byte[]... keys) {
if(isQueueing()) {
throw new UnsupportedOperationException();
}
try {
if (isPipelined()) {
pipeline(new LettuceStatusResult(getAsyncDedicatedConnection().watch(keys)));
return;
} else {
getDedicatedConnection().watch(keys);
}
getDedicatedConnection().watch(keys);
} catch (Exception ex) {
throw convertLettuceAccessException(ex);
}