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 exit 0
fi 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 $! > "$PID_FILE"
echo "started pid=$(cat "$PID_FILE") log=$LOG_FILE" echo "started pid=$(cat "$PID_FILE") log=$LOG_FILE"
START START

View File

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

View File

@@ -58,7 +58,7 @@
<td th:text="${role.roleId()}">10</td> <td th:text="${role.roleId()}">10</td>
<td th:text="${role.roleName()}">HR_DEPT_ROLE</td> <td th:text="${role.roleName()}">HR_DEPT_ROLE</td>
<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> th:text="${role.maxSensitivityLevel()}">PUBLIC</span>
<form method="post" action="/roles/max-sensitivity" class="inline-form"> <form method="post" action="/roles/max-sensitivity" class="inline-form">
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"> <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}">