diff --git a/.github/workflows/backend-dev-ci-cd.yml b/.github/workflows/backend-dev-ci-cd.yml index 7b872a4ee..2ec670248 100644 --- a/.github/workflows/backend-dev-ci-cd.yml +++ b/.github/workflows/backend-dev-ci-cd.yml @@ -8,7 +8,7 @@ on: - ".github/workflows/backend-dev-ci-cd.yml" - "Dockerfile" # pull_request: - # branches: [ "develop" ] + # branches: [ "chongdae" ] # paths: # - "backend/**" # - ".github/workflows/backend-dev-ci-cd.yml" diff --git a/backend/src/main/java/com/zzang/chongdae/offering/repository/entity/OfferingEntity.java b/backend/src/main/java/com/zzang/chongdae/offering/repository/entity/OfferingEntity.java index 81b0aaf85..d3d9cf802 100644 --- a/backend/src/main/java/com/zzang/chongdae/offering/repository/entity/OfferingEntity.java +++ b/backend/src/main/java/com/zzang/chongdae/offering/repository/entity/OfferingEntity.java @@ -12,6 +12,7 @@ import jakarta.persistence.Entity; import jakarta.persistence.EnumType; import jakarta.persistence.Enumerated; +import jakarta.persistence.FetchType; import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; @@ -48,7 +49,7 @@ public class OfferingEntity extends BaseTimeEntity { private Long id; @NotNull - @ManyToOne + @ManyToOne(fetch = FetchType.LAZY) private MemberEntity member; @NotNull diff --git a/backend/src/main/java/com/zzang/chongdae/offering/service/OfferingService.java b/backend/src/main/java/com/zzang/chongdae/offering/service/OfferingService.java index c7994bc1e..2a6f682a3 100644 --- a/backend/src/main/java/com/zzang/chongdae/offering/service/OfferingService.java +++ b/backend/src/main/java/com/zzang/chongdae/offering/service/OfferingService.java @@ -54,6 +54,7 @@ public class OfferingService { private final OfferingFetcher offeringFetcher; private final Clock clock; + @Transactional(readOnly = true) public OfferingDetailResponse getOfferingDetail(Long offeringId, MemberEntity member) { OfferingEntity offering = offeringRepository.findById(offeringId) .orElseThrow(() -> new MarketException(OfferingErrorCode.NOT_FOUND)); @@ -72,6 +73,7 @@ public OfferingAllResponseItem getOffering(Long offeringId) { return new OfferingAllResponseItem(offering, offeringPrice); } + @Transactional(readOnly = true) public OfferingAllResponse getAllOffering(String filterName, String searchKeyword, Long lastId, Integer pageSize) { Pageable pageable = PageRequest.ofSize(pageSize); OfferingFilter filter = OfferingFilter.findByName(filterName); @@ -186,6 +188,7 @@ private void updateStatus(OfferingEntity offering) { // TODO : 도메인 분리 } @WriterDatabase + @Transactional public void deleteOffering(Long offeringId, MemberEntity member) { OfferingEntity offering = offeringRepository.findById(offeringId) .orElseThrow(() -> new MarketException(OfferingErrorCode.NOT_FOUND)); diff --git a/backend/src/main/resources/application.yml b/backend/src/main/resources/application.yml index afdf484dc..8ef0d9c9b 100644 --- a/backend/src/main/resources/application.yml +++ b/backend/src/main/resources/application.yml @@ -1,8 +1,17 @@ +server: + tomcat: + threads: + max: 35 + max-connections: 1024 + accept-count: 242 + spring: application: name: chongdae datasource: url: jdbc:h2:mem:database + hikari: + maximum-pool-size: 8 jpa: show-sql: true defer-datasource-initialization: true