public static void createHistoryEntry(Object entity, Number id, String user, String property, Class<?> valueClass, Object oldValue, Object newValue) { long begin = System.currentTimeMillis(); String oldVals = histValueToString(valueClass, oldValue); String newVals = histValueToString(valueClass, newValue); PfEmgrFactory emf = ApplicationContextProvider.getApplicationContext().getBean(PfEmgrFactory.class); emf.runInTrans((emgr) -> { HistoryServiceManager.get().getHistoryService().insertManualEntry(emgr, EntityOpType.Update, entity.getClass().getName(), id, user, property, valueClass.getName(), oldVals, newVals); return null; }); long end = System.currentTimeMillis(); log.info("HistoryBaseDaoAdapter.createHistoryEntry took: " + (end - begin) + " ms."); }