spring-projects / spring-projects/spring-data-redis

Transactions - read-only operations are also queued [DATAREDIS-600]

Open
#1,175 4 comments 0 reactions 1 assignee View on GitHub

@mp911de is already working on this.

Since Dec 30, 2020.

in: jedis type: bug type: documentation
Dominant language
Java
Stars
1.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Mircea Gaceanu opened DATAREDIS-600 and commented

It seems all operations inside a transaction are queued. According to the documentation the readonly operations should run a new connection (http://docs.spring.io/spring-data/redis/docs/current/reference/html/#tx.spring).
This prevents implementing "read-and-modify" transactions!

Test case throwing NPE:

 @Test
    public void testTemplateTransaction() {
        redisTemplate.opsForValue().set("foo", "bar");

        redisTemplate.multi();

        Set keys = redisTemplate.keys("*");
        Assert.assertFalse(keys.isEmpty()); // NPE

        redisTemplate.exec();
    }

Did I get something wrong here? It's too strange :-)


Affects: 1.8 GA (Ingalls)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.