use of com.haulmont.cuba.core.sys.persistence.DbTypeConverter in project cuba by cuba-platform.
the class ServerInfo method applicationStopped.
@Override
public void applicationStopped() {
try {
infoUpdateTimer.cancel();
infoUpdateTimer.purge();
log.trace("Updating server information in the database");
DbTypeConverter types = persistence.getDbTypeConverter();
Object tsObj = types.getSqlObject(timeSource.currentTimestamp());
int tsType = types.getSqlType(Date.class);
Object falseObj = types.getSqlObject(Boolean.FALSE);
int boolType = types.getSqlType(Boolean.class);
QueryRunner runner = new QueryRunner(persistence.getDataSource());
runner.update("update SYS_SERVER set UPDATE_TS = ?, IS_RUNNING = ? where NAME = ?", new Object[] { tsObj, falseObj, getServerId() }, new int[] { tsType, boolType, Types.VARCHAR });
} catch (Exception e) {
log.error("Unable to update SYS_SERVER: {}", e);
}
}
Aggregations