0% found this document useful (0 votes)
63 views3 pages

Your Answer

This document contains 10 multiple choice questions about Spring framework concepts including transaction management, declarative and programmatic transactions, transaction propagation behaviors, Spring data access technologies, and Spring classes for working with databases like JdbcTemplate and ResultSetExtractor. Each question includes the question text, the user's answer, the correct answer, and an optional description.

Uploaded by

GURU
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views3 pages

Your Answer

This document contains 10 multiple choice questions about Spring framework concepts including transaction management, declarative and programmatic transactions, transaction propagation behaviors, Spring data access technologies, and Spring classes for working with databases like JdbcTemplate and ResultSetExtractor. Each question includes the question text, the user's answer, the correct answer, and an optional description.

Uploaded by

GURU
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Question: 1 Why is it a best practice to mark transaction as read-only when code does not write

anything to the
database? Select one.

Your Answer: None

Correct Answer: May be improve performance when using Hibernate

Description: None

Question: 2 What is the transaction behavior of the PROPAGATION_REQUIRES_NEW


mode? Select a unique
answer.

Your Answer: None

Correct Answer: The current method must start a new transaction and run within its own
transaction. If there is an existing transaction in progress, it is suspended.

Description: None

Question: 3 Does Spring provides programmatic transaction management? Select a unique


answer.

Your Answer: None

Correct Answer: Yes with the TransactionTemplate class

Description: The TransactionTemplate class provides an execute(TransactionCallback) method

Question: 4 What is/are incorrect statements about XML declaration of the transaction manager
bean? Select correct option

Your Answer: None

Correct Answer: Id of the bean has to be transactionManager

Description: Id of the transaction manager bean could be customized (ie. txManager)


Question: 5 What data access technology is not supported by the Spring framework?

Your Answer: None

Correct Answer: NoSQL

Description: None

Question: 6 What configuration is supported by the LocalSessionFactoryBean? Select a unique


answer.

Your Answer: None

Correct Answer: Listing hibernate XML mapping configuration file (.hbm.xml)

Description: None

Question: 7 Assuming @Transactional annotation support is enabled and the transferMoney


method is called
through a Spring AOP proxy, what is the behavior of the following code sample?
@Transactional(propagation=Propagation.REQUIRED)
public void transferMoney(Account src, Account target, double amount) {
add(src, -amount);
add(src, amount);
}
@Transactional(propagation=Propagation.REQUIRES_NEW)
public void add(Account account, Double amount) {
// IMPLEMENTATION
}

Your Answer: None

Correct Answer: The add() method uses the transaction of the transferMoney() method

Description: None

Question: 8 What is not provided by the JdbcTemplate? Select a unique answer.

Your Answer: None


Correct Answer: Data source access

Description: A JdbcTemplate requires a DataSource as input parameters

Question: 9 What is the default rollback policy in transaction management?

Your Answer: None

Correct Answer: Rollback for RuntimeException

Description: None

Question: 10 Using JdbcTemplate, what is the Spring provided class you will use for result set
parsing and merging
rows into a single object? Select a unique answer.

Your Answer: None

Correct Answer: ResultSetExtractor

Description: ResultSetExtractor : for result set parsing and merging rows into a single object

Finish

You might also like