@Test public void testFirstReadNextWrite() { log.debug("test first read next write============begin"); User user = genUser(); userService.save(user); // 1 choice write datasource user = userService.findById(user.getId()); // 2 choice read datasource userService.delete(user.getId()); // 3 choice write datasource log.debug("test first read next write============end"); }
@Test public void testOnlyWrite() { log.debug("test only write============begin"); User user = genUser(); userService.save(user); // 1 choice write datasource userService.delete(user.getId()); // 2 choice write datasource User user2 = genUser(); Address address2 = genAddress(); userService.save(user2, address2); // 3 choice write datasource 此处内部会传播事务 userService.delete(user2.getId()); // 4 choice write datasource log.debug("test only write============end"); }
@Test public void testFirstWriteNextRead() { log.debug("test first write next read============begin"); userService.testFirstWriteNextRead(genUser()); log.debug("test first write next read============end"); }
@Test public void testOnlyRead() { log.debug("test only read============begin"); userService.findById(1); log.debug("test only read============end"); }