diff --git a/src/main/java/org/springframework/data/redis/core/RedisConnectionUtils.java b/src/main/java/org/springframework/data/redis/core/RedisConnectionUtils.java index 7f4c0d90b..521e2440b 100644 --- a/src/main/java/org/springframework/data/redis/core/RedisConnectionUtils.java +++ b/src/main/java/org/springframework/data/redis/core/RedisConnectionUtils.java @@ -187,7 +187,7 @@ public abstract class RedisConnectionUtils { * * @param conn the Redis connection to close. * @param factory the Redis factory that the connection was created with. - * @deprecated since 2.1.9, use {@link #releaseConnection(RedisConnection, RedisConnectionFactory, boolean)} + * @deprecated since 2.1.10, use {@link #releaseConnection(RedisConnection, RedisConnectionFactory, boolean)} instead. */ @Deprecated public static void releaseConnection(@Nullable RedisConnection conn, RedisConnectionFactory factory) { @@ -200,11 +200,11 @@ public abstract class RedisConnectionUtils { * * @param conn the Redis connection to close. * @param factory the Redis factory that the connection was created with. - * @param enableTransactionSupport whether transaction support is enabled. + * @param transactionSupport whether transaction support is enabled. * @since 2.1.9 */ public static void releaseConnection(@Nullable RedisConnection conn, RedisConnectionFactory factory, - boolean enableTransactionSupport) { + boolean transactionSupport) { if (conn == null) { return; @@ -223,9 +223,9 @@ public abstract class RedisConnectionUtils { // release transactional/read-only and non-transactional/non-bound connections. // transactional connections for read-only transactions get no synchronizer registered - if (enableTransactionSupport && TransactionSynchronizationManager.isCurrentTransactionReadOnly()) { + if (transactionSupport && TransactionSynchronizationManager.isCurrentTransactionReadOnly()) { if (log.isDebugEnabled()) { - log.debug("Unbinding Redis Connection"); + log.debug("Unbinding Redis Connection."); } unbindConnection(factory); } else { @@ -233,13 +233,13 @@ public abstract class RedisConnectionUtils { // Not participating in transaction management. // Connection could have been attached via session callback. if (log.isDebugEnabled()) { - log.debug("Leaving bound Redis Connection attached"); + log.debug("Leaving bound Redis Connection attached."); } } } else { if (log.isDebugEnabled()) { - log.debug("Closing Redis Connection"); + log.debug("Closing Redis Connection."); } conn.close(); } diff --git a/src/test/java/org/springframework/data/redis/core/RedisTemplateUnitTests.java b/src/test/java/org/springframework/data/redis/core/RedisTemplateUnitTests.java index 027823519..c2f55d197 100644 --- a/src/test/java/org/springframework/data/redis/core/RedisTemplateUnitTests.java +++ b/src/test/java/org/springframework/data/redis/core/RedisTemplateUnitTests.java @@ -111,6 +111,7 @@ public class RedisTemplateUnitTests { @Nullable @Override public Object execute(RedisOperations operations) throws DataAccessException { + template.multi(); template.multi(); return null; @@ -129,6 +130,7 @@ public class RedisTemplateUnitTests { template.execute(new SessionCallback() { @Override public Object execute(RedisOperations operations) throws DataAccessException { + template.multi(); template.multi(); return null; @@ -146,8 +148,10 @@ public class RedisTemplateUnitTests { TransactionSynchronizationManager.setCurrentTransactionReadOnly(true); template.execute(new SessionCallback() { + @Override public Object execute(RedisOperations operations) throws DataAccessException { + template.multi(); template.multi(); return null;