Fixed - LiveObjects with indexed field can't be stored using batch persist method. #3710

pull/3770/head
Nikita Koksharov 4 years ago
parent dcb7ed5a4e
commit aa13bc39e1

@ -210,7 +210,9 @@ public class AccessorInterceptor {
} }
} }
ce.execute(); if (ce != commandExecutor) {
ce.execute();
}
} }
private void removeAsync(CommandBatchService ce, String name, String mapName, Codec codec, Object value, String fieldName) { private void removeAsync(CommandBatchService ce, String name, String mapName, Codec codec, Object value, String fieldName) {

@ -2,7 +2,6 @@ package org.redisson;
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.redisson.api.*; import org.redisson.api.*;
import org.redisson.api.annotation.*; import org.redisson.api.annotation.*;
import org.redisson.api.condition.Conditions; import org.redisson.api.condition.Conditions;
@ -18,6 +17,7 @@ import java.util.*;
import java.util.concurrent.*; import java.util.concurrent.*;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.*;
/** /**
* *
@ -359,6 +359,23 @@ public class RedissonLiveObjectServiceTest extends BaseTest {
} }
} }
@Test
public void testIndexedPersist() {
RLiveObjectService liveObjectService = redisson.getLiveObjectService();
TestIndexed item1 = new TestIndexed("1");
item1.setName1("testnma");
item1.setName2("gfgfgf");
item1.setNum1(123);
TestIndexed item2 = new TestIndexed("2");
List<TestIndexed> s = liveObjectService.persist(item1, item2);
assertThat(s.get(0).getId()).isEqualTo(item1.getId());
assertThat(s.get(1).getId()).isEqualTo(item2.getId());
redisson.shutdown();
}
@Test @Test
public void testFindIn() { public void testFindIn() {
RLiveObjectService s = redisson.getLiveObjectService(); RLiveObjectService s = redisson.getLiveObjectService();

Loading…
Cancel
Save