@Override public long save(final Pool pool) throws IOException { currentSession().flush(); Long id; if (pool.getId() == PoolImpl.UNSAVED_ID) { id = (Long) currentSession().save(pool); currentSession().flush(); } else { if (pool.isDiscarded()) { getBoxStore().removeBoxableFromBox(pool); pool.setVolume(0D); } id = pool.getId(); currentSession().update(pool); currentSession().flush(); ChangeLogEntry log; while ((log = changeLogQueue.poll()) != null) { pool.createChangeLog(log.summary, "contents", log.pool.getLastModifier()); } } return id; }
changeLog.setSummary(message.toString()); changeLog.setTime(new Date()); changeLog.setUser(managed.getLastModifier()); changeLogService.create(changeLog);