Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
Issue #492
  • Loading branch information
rsoika committed Apr 5, 2022
1 parent 7410ade commit 7966228
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.enterprise.context.ApplicationScoped;
import javax.faces.model.SelectItem;
import javax.persistence.OptimisticLockException;

import org.imixs.workflow.ItemCollection;
import org.imixs.workflow.exceptions.AccessDeniedException;
Expand Down Expand Up @@ -86,6 +88,8 @@ public class ConfigController implements Serializable {

private static final long serialVersionUID = 1L;

private static Logger logger = Logger.getLogger(ConfigController.class.getName());

private String name = "CONFIGURATION";

private ItemCollection configItemCollection = null;
Expand Down Expand Up @@ -195,10 +199,12 @@ public void save() throws AccessDeniedException {
// save entity
try {
configItemCollection = configService.save(configItemCollection);
System.out.println("...configuration " + this.getName() + " updated!");
} catch (Exception e) {
System.out.println("...Failed to save configuration " + this.getName() + " : " + e.getMessage() + " - reloading config!");
logger.info("...configuration " + this.getName() + " updated!");
} catch (OptimisticLockException e) {
logger.warning("...Failed to save configuration " + this.getName() + " : " + e.getMessage() + " - reloading config!");
configItemCollection = configService.loadConfiguration(getName(), true);
// force Exception
throw e;
}
}

Expand Down

0 comments on commit 7966228

Please sign in to comment.