diff --git a/src/main/java/redis/clients/jedis/Transaction.java b/src/main/java/redis/clients/jedis/Transaction.java index 8730d85861..de2800e9f2 100644 --- a/src/main/java/redis/clients/jedis/Transaction.java +++ b/src/main/java/redis/clients/jedis/Transaction.java @@ -91,4 +91,30 @@ public void setClient(Client client) { public void close() { clear(); } -} \ No newline at end of file + + private static final String WATCH_INSIDE_MULTI_MESSAGE = "WATCH inside MULTI is not allowed"; + + /** + * @param keys + * @return + * @throws UnsupportedOperationException + * @deprecated {@value #WATCH_INSIDE_MULTI_MESSAGE} + */ + @Override + @Deprecated + public Response watch(String... keys) throws UnsupportedOperationException { + throw new UnsupportedOperationException(WATCH_INSIDE_MULTI_MESSAGE); + } + + /** + * @param keys + * @return + * @throws UnsupportedOperationException + * @deprecated {@value #WATCH_INSIDE_MULTI_MESSAGE} + */ + @Override + @Deprecated + public Response watch(byte[]... keys) throws UnsupportedOperationException { + throw new UnsupportedOperationException(WATCH_INSIDE_MULTI_MESSAGE); + } +}