gpt4 book ai didi

java - 如何在 Aerospike Spring Data 中使用 CAS 感知策略保存文档

转载 作者:行者123 更新时间:2023-11-30 05:23:44 24 4
gpt4 key购买 nike

谁能告诉我如何在 Spring Data Aerospike 中使用 CAS 感知策略保存文档,以便它使用记录中的生成来使用 EXPECT_GEN_EQUAL 生成更新文档政策?

我试过这个:

Customer customer = customerRepositoryTest.findOne("335672888");
customer.setFieldX(some value)
customerRepository.save(customer);

但我发现 Aerospike Spring Data 始终使用 NONE Generation 策略,因此它在调用 save 时始终忽略版本属性(生成)并覆盖记录。

有人有想法吗?谢谢!

最佳答案

您应该将 spring-data-aerospike 依赖项与 groupId com.aerospike 结合使用,因为它包含对项目提供的所有修复: https://mvnrepository.com/artifact/com.aerospike/spring-data-aerospike

2.2.0.RELEASE 已经支持 Spring Boot 2.2。2.1.1.RELEASE 适用于 Spring Boot 2.1。

关于java - 如何在 Aerospike Spring Data 中使用 CAS 感知策略保存文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59065069/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com