kbank 소스 일부 복원

This commit is contained in:
Rinjae
2025-11-06 14:43:42 +09:00
parent e3f579a9ab
commit fce34fd98b
3 changed files with 506 additions and 413 deletions
@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.sql.SQLException;
@Component
@Aspect
@@ -16,9 +17,9 @@ public class JpaErrorLoggingAspect {
private EntityManager em;
@AfterThrowing(pointcut = "@annotation(org.springframework.transaction.annotation.Transactional)", throwing = "ex")
public void onError(Exception ex) {
public void onError(SQLException ex) {
try {
String user = (String) em.createNativeQuery("select user from user").getSingleResult();
String user = (String) em.createNativeQuery("select user from dual").getSingleResult();
log.error("DB USER = {}, SQL ERROR = {}", user, ex.getMessage() );
} catch (Exception e) {
log.error("Failed to fetch DB User", e);