相关试题
单选题 考虑下图中的事务性服务层类。你使用的是 Spring 事务,它内部使用 Spring AOP 调用 update1 方法时,发生了什么事情? (选择一项) public class ClientServiceImpl implements ClientService{ @Transactional (propagation=Propagation.REQUIRED) public void update1(){ update2(); } @Transactional(propagation=Propagation.REQUIRES_NEW) public void update2(){ } }
单选题 以下哪项是对@PropertySource 注解的最佳解释?(选择一项)
单选题 考虑下图中的事务服务层类。 @Transactional(timeout=60) public class ClientServiceImpl implements ClientService { @Transactional(timeout=30) public void update1(){} }} 对事务的 update1 方法应用什么超时设置?(选择一项)
单选题 关于 Spring 对 JPA 的支持,以下哪个说法是正确的?(选择一项) (1) Spring 支持结合本地或全局事务管理 JPA PersistenceContexts (2) JPA 提供者是通过设置 EntityManagerFactoryBean 上的 vendor adapter 属性来指定的 (3) 在管理本地事务时,JpaTransactionManager 使用 JPA EntityManagers 来完成这项工作
单选题 Spring RestTemplate 类:(选择一项)
单选题 考虑以下来自 @Configuration 类的代码,并应用 Spring 的默认行为,选择正确答案(选择一项) @Configuration public class MyConfig { @Bean public AccountRepository accountRepository(){ return new JdbcAccountRepository(); } @Bean public TransferService transferService(){ TransferServiceImpl service = new TransferServiceImpl(); service.setAccountRepository(accountRepository()); return service; } @Bean public AccountService accountService(){ return new AccountServiceImpl(accountRepository()); } }
单选题 已给出下面的 pointcut,下列哪些关于 Spring AOP 的说法是正确的?(选择一项) execution(@com.mycomp.MyCustomAnnotation void *(..)) 1. Spring 不支持其 pointcut 表达式语言内部的注解 2. 这将选择代表被@com.mycomp.MyCustomAnnotation 注解的 void 方法的 join point 3. 这将选择代表只位于根包中的类的方法的 join point 4. 这个 pointcut 将永远无法选择任何 join point
单选题 当使用 Spring Boot 配置和运行 Web 应用程序时,你应包含哪个依赖项以在开发过程中更改代码时启用应用程序的自动重启?(选择一项)