public class ClientServiceImpl implements ClientService {
@Transactional(propagation=Propagation.REQUIRED)
public void update1() {
update2();
}
@Transactional(propagation=Propagation.REQUIRES_NEW)
public void update2() { // ... }
}
You are using transactions with Spring AOP. What is happening when the update1 method is called? (Select one)
A. There is only one transaction because the call to update2() is internal (it does not go through the proxy)
B. There is only one transaction because REQUIRES_NEW runs into the active transaction if one already exists
C. There are 2 transactions because REQUIRES_NEW always runs in a new transaction
正解:A
質問 2:
Using declarative transaction management, by default a transaction rolls back if:
A. Any uncaught exception that inherits from Exception has been thrown
B. Null is being returned by a non-void method
C. Any uncaught exception that inherits from RuntimeException has been thrown
D. Any uncaught Throwable that inherits from Throwable has been thrown
正解:C
質問 3:
Which statement best describes the advantage of using AfterReturning advice, rather than simply using after advice? (Select one)
A. AfterReturning advice is only invoked if the method returns successfully, allowing you to limit advice to only those scenarios
B. If an exception is thrown in the join point, it is allowed to propagate, which is not the case with After advice
C. After advice can only be applied to methods which are declared as void
D. AfterReturning advice is invoked if an exception is thrown, which is not the case with After advice
正解:A
質問 4:
Two beans of type MyBean are defined in the ApplicationContext with singleton scope, with ids "myBean1" and "myBean2". The getBean() method is called once for each bean. Which statement is true about the two references returned? (Select one)
A. Both references refer to the same bean instance
B. The two references refer to different instances of the same type
C. A RuntimeException will be thrown when the ApplicationContext is initialized
D. One of the references will be null
正解:B
質問 5:
Which of the following statements is NOT true with respect to Spring's ApplicationContext? (select one)
A. There are many different implementation classes which all implement the ApplicationContext interface
B. In a JUnit test using Spring support (with @ContextConfiguration annotation), it is necessary to close the ApplicationContext manually
C. When available, the close() method will cause any registered bean destruction code to be invoked
D. The ApplicationContext eagerly instantiates all singleton beans by default
正解:B
質問 6:
Which of the following statements comparing traditional RMI with Spring RMI is NOT true? (select one)
A. Both approaches require you to extend the UnicastRemoteObject class on the server side
B. Both approaches require method parameters and return values to implement java.io.Serializable
C. Traditional RMI requires the client to catch RemoteExceptions, but Spring's approach does not
D. Traditional RMI requires implementing java.rmi.Remote, but Spring's approach does not
正解:A
質問 7:
What is the principal purpose of Spring's Security tag library? (Select one)
A. To allow Spring Security to be applied to XHTML
B. To provide functionality in JSP pages, such as hiding certain sections based on roles
C. To allow certain URLs to be tagged as requiring secure access
D. To provide a mechanism for applying security to Spring Web Services
正解:B
質問 8:
ClientService service = applicationContext.getBean(ClientService.class)
Which statement is true with regards to the above example? (select one)
A. It returns the bean called "ClientService"
B. It returns a bean of the type ClientService (regardless of its id or name)
C. This syntax is not valid because the bean id must be specified as a method param
D. This syntax is not valid because the result of the getBean method should be explicitely cast into ClientService
正解:B
Kasahara -
CoreSpringV3.2問題集は絶対唯一無二な参考資料です。内容は全面的で、覚えやすいです。みんなのCoreSpringV3.2試験に合格することを保障できます。