SpringSource Core-Spring (based on Spring 3.2) Sample Questions:
1. Which of the following are valid mechanisms of autowiring a dependency when multiple beans match the dependency's type? (Select one or several answers)
A) Use of the @Qualifier and @Autowired annotations together with setter methods
B) Use of the @Qualifier and @Autowired annotations together on a field
C) Use of the @Qualifier annotation solely
2. Which of the following statements is true with respect to Spring's support for Object-Relational Mapping (ORM) libraries (select one)
A) Spring provides support for translating exceptions thrown from ORM libraries into Spring's own exception hierarchy
B) Spring provides FactoryBeans to configure each of the supported ORM libraries
C) All of the above is true
D) Spring supports management of Hibernate Sessions or JPA PersistenceContexts in combination with local transactions
3. Which statement is NOT a characteristic of Spring's PlatformTransactionManager base interface (select one)
A) PlatformTransactionManager is used in both declarative and programmatic transaction management
B) The PlatformTransactionManager interface abstracts the differences between local and JTA transactions
C) When declaring a PlatformTransactionManager implementation inside Spring configuration: as a requirement, the bean id should be "transactionManager"
D) There are various implementations of JTA transaction managers for different Java EE containers
4. Given an ApplicationContext containing multiple bean definitions of a Java type "Foo", which of the following @Autowired scenarios will cause the ApplicationContext to FAIL to initialize? Assume that the ApplicationContext is configured to process the @Autowired annotations. (Select one)
A) @Autowired private Foo foo;
B) @Autowired public void setFoo(Foo aFoo) {}
C) Neither a or b
D) Both a and b
5. 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 REQUIRES_NEW runs into the active transaction if one already exists
B) There are 2 transactions because REQUIRES_NEW always runs in a new transaction
C) There is only one transaction because the call to update2() is internal (it does not go through the proxy)
Solutions:
| Question # 1 Answer: A,B | Question # 2 Answer: C | Question # 3 Answer: C | Question # 4 Answer: D | Question # 5 Answer: C |

We're so confident of our products that we provide no hassle product exchange.


By Jennifer


