Skip to content

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

Open
@spring-projects-issues

Description

@spring-projects-issues

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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions