웹개발(23)
-
MSSQL CPU 점유 성능 향상
DB 서버의 CPU가 100프로를 찍을 때가 있어서 찾아보았다. SQL SERVER 에서 최대 병렬 처리 관련해서 처리할수있다. max degree of parallelism 옵션(MAXDOP) 을 쿼리에 적용 할 수 있고 데이터베이스에 옵션 설정을 할 수 있다. USE AdventureWorks2012 ; GO EXEC sp_configure 'show advanced options', 1; GO RECONFIGURE WITH OVERRIDE; GO EXEC sp_configure 'max degree of parallelism', 16; GO RECONFIGURE WITH OVERRIDE; GO 위의 SQL은 데이터베이스 옵션을 변경 설정 하는것이다. 쿼리에서 옵션을 설정 할수도 있다. USE Adv..
2023.07.03 -
Spring Boot Security 사용자별 동시접속자 수 제어
@Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { return http // .addFilterBefore(new CustomAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class) .httpBasic().and() .sessionManagement((sessionManagement) -> sessionManagement // .sessionAuthenticationStrategy(sessionControlStrategy()) // .sessionCreationPolicy(SessionCreationPolicy.STATELESS) // .ses..
2023.06.30 -
Spring Boot + JPA 작성일자 자동 수정 방지
@CreationTimestamp @Column(updatable=false) private LocalDateTime createAt; // 작성일자 updatable = false 를 사용 하면 Entity가 Update 될때 변경되지 않는다.
2023.06.29 -
SpringBoot + JPA 조인테이블 직접 설정 및 정렬 컬럼 추가
// 강좌 와 시리즈 조인 테이블 @Data @Entity @Builder @AllArgsConstructor @NoArgsConstructor public class LectureSeriesLecture{ @Id private Long id; @ManyToOne @JoinColumn(name="lectureSeriesId") private LectureSeries lectureSeries; @ManyToOne @JoinColumn(name="lectureId") private Lecture lecture; private Long orderNum; } 위 테이블은 생성되는 조인테이블을 대체할 Entity 이다 // 강좌 시리즈 테이블 @Data @Entity @EqualsAndHashCode(of = "..
2023.06.28 -
Spring Boot + Thymeleaf Tag JAVA CUSTOM UTIL 사용
@Component public class CustomUtils { public static String removeTag(String html) throws Exception { return html.replaceAll("]*)?(\\s)*(/)?>", ""); } } 자바 Class 에 Component 추가 후 Thymeleaf 에서 이런 식으로 사용할 수 있다.
2023.06.27