스프링

· 스프링
트랜잭션을 위한 어드바이저트랜잭션을 위한 어드바이저는 ProxyTransactionManagementConfiguration에서 등록되는 BeanFactoryTransactionAttributeSourceAdvisor를 통해 생성됩니다. AspectJ로 선언한 어드바이저우선 AspectJ는 @EnableAspectJAutoProxy를 통해 활성화합니다.이후 @EnableAspectJAutoProxy를 통해 등록된 AspectJAutoProxyRegistrar에서 AopConfigUtils.registerAspectJAnnotationAutoProxyCreatorIfNecessary(registry)를 통해 org.springframework.aop.config.internalAutoProxyCreator..
· 스프링
Spring이 시작되면 AbstractApplicationContext의 refresh 메서드를 통해 컨텍스트 관련 설정이 시작됩니다. ConfigurableListableBeanFactory beanFactory = obtainFreshBeanFactory();// Invoke factory processors registered as beans in the context. invokeBeanFactoryPostProcessors(beanFactory); // Register bean processors that intercept bean creation. registerBeanPostProcessors(beanFactory); // Instantiate all remaining (non-laz..
· 스프링
@Transactional 메서드가 실행되는 과정Spring에서 @Transactional이 선언된 메서드를 실행할 때, 내부적으로 TransactionAspectSupport의 invokeWithinTransaction 메서드가 호출됩니다. // spring-tx 6.1.6 기준// This is an around advice: Invoke the next interceptor in the chain. // This will normally result in a target object being invoked. retVal = invocation.proceedWithInvocation();해당 메서드의 392번 라인에서 invocation.proceedWithInvocation()을 호출하며, 트..
· 스프링
Spring TestContext 프레임워크는 단일 JVM 내에서 테스트를 병렬로 실행하기 위한 기본적인 지원을 제공한다.테스트 스위트에 동시성을 도입하면 예기치 않은 부작용, 이상한 런타임 동작, 간헐적으로 또는 무작위로 실패하는 테스트가 발생할 수 있다. 따라서 Spring 팀은 테스트를 병렬로 실행하지 않는 경우에 대한 다음과 같은 일반적인 지침을 제공한다. 병렬로 테스트하는 것을 권장하지 않는 경우테스트가 다음과 같은 경우 테스트를 병렬로 실행하지 말자.Spring 프레임워크의 @DirtiesContext를 사용하는 경우Spring Framework의 @MockitoBean 또는 @MockitoSpyBean을 사용하는 경우Spring Boot의 @MockBean 또는 @SpyBean을 사용하는 경..
· 스프링
Spring Modulith 에서는@ApplicationModuleTest가 선언된 테스트에 Scenario를 파라미터로 전달한다. Scenario는 아래 단계를 정의하고 정의를 안내하는 API를 노출한다.시스템에 대한 자극(stimulus, publish)을 정의한다. 일반적으로 이벤트 게시 또는 모듈에 의해 노출된 Spring 구성 요소의 호출이 해당한다.실행의 기술적 세부 사항(시간 초과 등)의 선택적 사용자 정의한다.어떤 예상된 결과를 정의한다. 특정 조건을 만족하는 또 다른 애플리케이션 이벤트가 발생하거나, 모듈의 상태 변화가 발생하여 이를 공개된 컴포넌트를 호출함으로써 감지할 수 있는 것을 의미한다.수신된 이벤트 또는 관찰된 변경된 상태를 확인한다.(선택 사항) Scenario 시작 (1)//..
· 스프링
EnableJpaRepositoriesEnableJpaRepositories에서 JpaRepository를 위한 설정을 구성한다.주요 설정basePackages: JpaRepository를 스캔할 기준 패키지repositoryImplementationPostfix: Custom Repository 구현의 Postfix, 기본 값은 ImplentityManagerFactoryRef: 엔티티 매니저 팩토리 이름, 기본 값은 entityManagerFactorytransactionManagerRef: 트랜젝션 메니저 이름, 기본 값은 transactionManager JpaRepositoriesRegistrar를 임포트한다.ImportBeanDefinitionRegistrar를 구현한 클래스로 @Configu..
belljun
'스프링' 카테고리의 글 목록 (2 Page)