SpringSource Core-Spring (based on Spring 3.2) Sample Questions:
1. Which of the following is a valid optional attribute for a transaction definition? (select one)
A) All of the above
B) Propagation behavior
C) A read-only flag
D) An isolation level
2. Spring's RMI Service Exporter provides which of the following services? (select one)
A) Transparently exposes an existing POJO service to the RMI registry
B) All of the above
C) Exposes services that can be accessed via plain RMI
D) Avoids the service interface having to extend Remote
3. 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)
4. Which of the following statements about the FactoryBean interface is NOT true? (select one)
A) A FactoryBean can be used to generate Spring beans of any type
B) The Spring configuration <property name="someValue" ref="myFactoryBeanImpl"/> will ALWAYS inject the instance of the FactoryBean implementation
C) Factory objects used in Spring do not necessarily have to implement the FactoryBean interface
D) FactoryBean is a Spring interface
5. Which of the following is the correct mechanism for using programmatic transactions in Spring? (Select one)
A) Use of the @Transactional annotation on the Class of methods which should all be transactional
B) Use of the @Transactional annotation on each method which should be transactional
C) Use of the Spring TransactionTemplate
D) Configuration in an XML configuration file using the Spring "tx" namespace
Solutions:
Question # 1 Answer: A | Question # 2 Answer: B | Question # 3 Answer: C | Question # 4 Answer: B | Question # 5 Answer: C |