spring-projects / spring-projects/spring-data-redis
Transactions - read-only operations are also queued [DATAREDIS-600]
Open
@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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.