Throw UnsupportedOpException on watch in tx in Lettuce
DATAREDIS-225
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -109,6 +109,11 @@ abstract public class AbstractConnectionTransactionIntegrationTests extends
|
||||
public void testHashNullValue() throws Exception {
|
||||
}
|
||||
|
||||
@Test(expected=UnsupportedOperationException.class)
|
||||
public void testWatchWhileInTx() {
|
||||
connection.watch("foo".getBytes());
|
||||
}
|
||||
|
||||
// Type conversion overrides
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user