public synchronized void save() throws RegistryException {
EntityManager em = null;
try {
em = ResourceUtils.getEntityManager();
//whether existing
Configuration existing = em.find(Configuration.class, new Configuration_PK(configKey, configVal, categoryID));
em.close();
em = ResourceUtils.getEntityManager();
em.getTransaction().begin();
Configuration configuration = new Configuration();
configuration.setConfig_key(configKey);
configuration.setConfig_val(configVal);
configuration.setExpire_date(expireDate);
configuration.setCategory_id(categoryID);
if (existing != null) {
existing.setExpire_date(expireDate);
existing.setCategory_id(categoryID);
configuration = em.merge(existing);
} else {