fix #558: stabilize deployment and role rendering

This commit is contained in:
devmrko
2026-06-29 17:18:21 +09:00
parent 908ac9a386
commit 95be60dd2e
3 changed files with 24 additions and 7 deletions

View File

@@ -174,7 +174,7 @@ if [[ -f "$PID_FILE" ]] && kill -0 "$(cat "$PID_FILE")" >/dev/null 2>&1; then
exit 0
fi
nohup java -jar "$APP_DIR/app.jar" > "$LOG_FILE" 2>&1 &
setsid nohup java -jar "$APP_DIR/app.jar" > "$LOG_FILE" 2>&1 < /dev/null &
echo $! > "$PID_FILE"
echo "started pid=$(cat "$PID_FILE") log=$LOG_FILE"
START

View File

@@ -14,6 +14,8 @@ import java.util.Locale;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -21,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
public class OrdsMetadataService {
private static final String VECTOR_SEARCH_OBJECT = "CB_VECTOR_SEARCH_DOCUMENTS";
private static final Logger log = LoggerFactory.getLogger(OrdsMetadataService.class);
private final OrdsMetadataMapper mapper;
private final JdbcTemplate jdbcTemplate;
@@ -40,6 +43,8 @@ public class OrdsMetadataService {
this.mapper = mapper;
this.jdbcTemplate = jdbcTemplate;
this.protectedObjectService = protectedObjectService;
HikariDataSource metadataDataSource = null;
JdbcTemplate metadataJdbcTemplate = new JdbcTemplate(dataSource);
if (hasText(ordsMetadataUrl) && hasText(ordsMetadataUsername)) {
HikariConfig config = new HikariConfig();
config.setPoolName("vpd-ords-metadata-pool");
@@ -50,13 +55,25 @@ public class OrdsMetadataService {
config.setMaximumPoolSize(2);
config.setMinimumIdle(0);
config.setConnectionTimeout(10000);
this.ordsMetadataDataSource = new HikariDataSource(config);
this.ordsMetadataJdbcTemplate = new JdbcTemplate(this.ordsMetadataDataSource);
} else {
this.ordsMetadataDataSource = null;
this.ordsMetadataJdbcTemplate = new JdbcTemplate(dataSource);
// ORDS metadata is an optional administrative connection. Do not fail
// the whole backoffice startup when the remote TNS host is temporarily
// unavailable; Handler create/update will report the connection error
// at the point of use instead.
config.setInitializationFailTimeout(-1);
try {
metadataDataSource = new HikariDataSource(config);
metadataJdbcTemplate = new JdbcTemplate(metadataDataSource);
} catch (RuntimeException exception) {
log.warn("ORDS metadata DB is unavailable; using the main DB for read-only fallback: {}",
exception.getMessage());
if (metadataDataSource != null) {
metadataDataSource.close();
}
}
}
this.ordsMetadataDataSource = metadataDataSource;
this.ordsMetadataJdbcTemplate = metadataJdbcTemplate;
}
public List<OrdsHandlerView> findHandlers() {
String packageSource = mapper.findHandlerPackageSource();

View File

@@ -58,7 +58,7 @@
<td th:text="${role.roleId()}">10</td>
<td th:text="${role.roleName()}">HR_DEPT_ROLE</td>
<td>
<span class="badge text-bg-light" th:title="'허용된 행의 컬럼 표시 상한: ' + role.maxSensitivityLevel()"
<span class="badge text-bg-light" th:title="${'허용된 행의 컬럼 표시 상한: ' + role.maxSensitivityLevel()}"
th:text="${role.maxSensitivityLevel()}">PUBLIC</span>
<form method="post" action="/roles/max-sensitivity" class="inline-form">
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}">