{"id":29690741,"url":"https://github.com/daejoon/requiresnew","last_synced_at":"2025-07-23T06:37:45.701Z","repository":{"id":270364146,"uuid":"910030678","full_name":"daejoon/RequiresNew","owner":"daejoon","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-30T15:10:57.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-30T16:20:35.893Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daejoon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-30T10:20:31.000Z","updated_at":"2024-12-30T15:11:00.000Z","dependencies_parsed_at":"2024-12-31T15:32:08.120Z","dependency_job_id":null,"html_url":"https://github.com/daejoon/RequiresNew","commit_stats":null,"previous_names":["daejoon/requiresnew"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/daejoon/RequiresNew","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daejoon%2FRequiresNew","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daejoon%2FRequiresNew/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daejoon%2FRequiresNew/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daejoon%2FRequiresNew/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daejoon","download_url":"https://codeload.github.com/daejoon/RequiresNew/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daejoon%2FRequiresNew/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266631707,"owners_count":23959422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-23T06:37:45.203Z","updated_at":"2025-07-23T06:37:45.687Z","avatar_url":"https://github.com/daejoon.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Propagation.REQUIRES_NEW 테스트\n\n`@Transactional(propagation = Propagation.REQUIRES_NEW)`를 사용하는 예제를 찾아보면 대부분\nDB에 로그를 추가할때 문제가 발생해도 실제 로직은 정상적으로 Commit 되게 하기 위해서 사용하는 예제이다.\n\n팀에서도 실제로 그 이유로 사용하고 있었는데 이번에 문제가 발생하면서 테스트 코드 및 디버깅을 하게 되었다.\n\n결론만 말하자면 REQUIRES_NEW 안쪽에서 try catch를 하더라도 Commit시 DML 관련 문제가 발생하면\nUnexpectedRollbackException 예외를 발생시키기 때문에 호출하는 쪽에서 try catch를 걸어주지 않으면 \n결국 예외가 발생해서 롤백 된다.\n\n호출 하는 곳마다 try catch를 걸기 싫다면 try catch로 감싸는 UserLogTryCatchService를 참고해서\n주입받은 UserLogService의 메소드를 try catch로 감싸는 것도 방법이다.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaejoon%2Frequiresnew","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaejoon%2Frequiresnew","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaejoon%2Frequiresnew/lists"}