Exception while updating config without attributes
teterev98 opened this issue · 1 comments
If I try to update config without attributes, it throws RuntimeException: Database error.
Property property = new Property.Builder("Property","value").build(); //creation of a Config without attributes Config config = new Config.Builder("Config_Name", Collections.singleton(property)).build(); Stream<Config> configStream = metaConfig.update(Stream.of(config)); config = new Config.Builder(configStream).findFirst().get(); property = new Property.Builder("newProperty","value").build(); //updating config without attributes configStream = metaConfig.update(Stream.of(new Config.Builder(config).properties(Collections.singleton(property)).build()));
While I was investigated this issue, I had found, that this problem could be caused in DbConfigRepository class in update(Connection connection, Config[] configs) in this part of a code
`config.getAttributes().ifPresent((attributes) -> {
try {
this.updateConfig(connection, (String)this.mapping.get("config-attributes"), config.getId(), attributes);
} catch (SQLException var6) {
exceptions.add(var6);
}
});
`
Hi, thanks for the info. Fixed in 1.9.