spring boot testcontainers “row was updated or deleted by another transaction”

I want to make an entity testing with with PostgreSQL testcontainers in my SPring boot 3.x app. First I try to insert some constraint violation records and then some valid records and then I want to delete all records, to continue testing.
In delete all records I get an error like this:
“row was updated or deleted by another transaction”.
AFAIK JPA tests run under transaction. Unfortunately the database is not in my scope, that’s why I cannot use @Version in the entity.

Thats my Entity:

@Entity
@Table(name= "E", schema = Const.SCHEME_NAME)
@Data
@NoArgsConstructor
@SuperBuilder
@EqualsAndHashCode
public class E {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false, updatable = false)
    @EqualsAndHashCode.Include
    private Long id;

    @NotNull(message = "{name.not-blank}")
    @Column(name="name", length = 150, nullable = false)
    private String name;

my repository is a simple JpaRepository:

@Repository
public interface ERepository extends JpaRepository<E, Long> {
}

my test is:

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Testcontainers
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
@ContextConfiguration(initializers = ETestApplication.TestContainersInitializer.class)
public class ETestApplication {

 static class TestContainersInitializer implements
            ApplicationContextInitializer<ConfigurableApplicationContext> {


    public static List<E> VALID=List.of(E.builder()
                            .name("asd")
                            .build()
    );
                  
    public static List<E> INVALID=List.of(E.builder()
                            .build()
    );

    @Override
    public void initialize(ConfigurableApplicationContext applicationContext) {
            TestPropertyValues.of(
                            "spring.datasource.url="+ postgresService.getJdbcUrl(),
                            "spring.datasource.username="+ postgresService.getUsername(),
                            "spring.datasource.password="+ postgresService.getPassword())
                    .applyTo(applicationContext.getEnvironment());
    }
    
    @Container
    private static PostgreSQLContainer<?> postgresService = new 
    PostgreSQLContainer<>("postgres:16-alpine")
            .withInitScript("sql/init.sql");

    @LocalServerPort
    protected int port;
    @Autowired
    protected ERepository repository;

    @BeforeAll
    public static void beforeAll() {
        try {
            postgresService.start();
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }

    @AfterAll
    public static void afterAll() {
        postgresService.stop();
    }

    protected void entityInsert(E e) {
        E saved = repository.save(e);
        Assertions.assertNotNull(saved);
        E restored = repository.findById(saved.getId())
                .orElseThrow(RuntimeException::new);
        Assertions.assertNotNull(restored);
        Assertions.assertEquals(saved, restored);
    }

    protected void entityUpdate(E e) {
        E updated = repository.save(e);
        Assertions.assertNotNull(updated);
        Assertions.assertEquals(e.entity, updated);
    }

    protected void entityDelete(E e) {
        repository.delete(e);
        repository.findById(e.getId())
                .ifPresent(d -> {
                    throw new RuntimeException("%s is not deleted".formatted(d));
                });
    }
    
    @Test
    @Order(1)
    void agentServiceTest() {
              
        INVALID.forEach(e -> {
            Assertions.assertThrows(e.expectedException, () ->
                            repository.save(e.entity),
                    "constraints violated but no exception");
        });

        VALID.forEach(e -> {
            entityInsert(e);
            e.setName("bsd");
            entityUpdate(e);
            entityDelete(e.entity);
        });

        repository.deleteAll();  // Exception:  Row was updated or deleted by another transaction 
        // continue testing...
    }


}

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật