Hi,
Sorry, this might be a very stupid mistake on my behalf but I can't even get basic persistence to work with Spring.
I have a very simple example:
@Slf4j
@Component
public class RootRepositoryImpl implements RootRepository {
private final EmbeddedStorageManager storageManager;
public RootRepositoryImpl() {
this.storageManager = EmbeddedStorage.start();
if (storageManager.root() == null) storageManager.setRoot(new Root());
}
@Override
public long update() {
return this.storageManager.storeRoot();
}
@Override
public Root find() {
return (Root) this.storageManager.root();
}
}
And in another class, I modify the root object
@PostMapping("/delete-small-files")
public Mono<Long> setDeleteSmallFiles(@RequestBody boolean value) {
Root root = rootRepository.find();
root.getEnabledProperties().setDeleteSmallFiles(value);
return Mono.just(rootRepository.update());
}
The first time I execute this, it updates and saves the changed value. However, running it again after restarting and the old value persists.
I'm using versions:
implementation 'one.microstream:storage.embedded:04.00.00-MS-GA'
implementation 'one.microstream:storage.embedded.configuration:04.00.00-MS-GA'
Where have I gone wrong here?