

MCQOPTIONS
Saved Bookmarks
This section includes 18 Mcqs, each offering curated multiple-choice questions to sharpen your Spring knowledge and support exam preparation. Choose a topic below to get started.
1. |
You just have to encapsulate your code block in a callback class that implements the TransactionCallback interface and pass it to the TransactionTemplate execute method for execution. In this way, you don’t need to repeat the boilerplate transaction management code for this block.a) Trueb) FalseAnswer: aExplanation: In this way, you don’t need to repeat the boilerplate transaction management code for this block. 13. A TransactionTemplate can accept a transaction callback object that implements:-a) TransactionCallbackb) TransactionCallbackWithoutResult classc) All of the mentionedd) None of the mentionedAnswer: cExplanation: A TransactionTemplate can accept a transaction callback object that implements either the TransactionCallback or an instance of the one implementer of that interface provided by the framework, the TransactionCallbackWithoutResult class. 14. Spring (since version 2.0) offers a transaction advice that can be easily configured via the:-a) rx:adviceb) bx:advicec) tx:adviced) none of the mentionedAnswer: cExplanation: This advice can be enabled with the AOP configuration facilities defined in the aop saop schema. 15. You can omit the transaction-manager attribute in the element if your transaction manager has the name transactionManager. |
A. | Trueb) FalseAnswer: aExplanation: In this way, you don’t need to repeat the boilerplate transaction management code for this block. 13. A TransactionTemplate can accept a transaction callback object that implements:-a) TransactionCallbackb) TransactionCallbackWithoutResult classc) All of the mentionedd) None of the mentionedAnswer: cExplanation: A TransactionTemplate can accept a transaction callback object that implements either the TransactionCallback or an instance of the one implementer of that interface provided by the framework, the TransactionCallbackWithoutResult class. 14. Spring (since version 2.0) offers a transaction advice that can be easily configured via the:-a) rx:adviceb) bx:advicec) tx:adviced) none of the mentionedAnswer: cExplanation: This advice can be enabled with the AOP configuration facilities defined in the aop saop schema. 15. You can omit the transaction-manager attribute in the element if your transaction manager has the name transactionManager.a) True |
B. | FalseAnswer: aExplanation: In this way, you don’t need to repeat the boilerplate transaction management code for this block. 13. A TransactionTemplate can accept a transaction callback object that implements:-a) TransactionCallbackb) TransactionCallbackWithoutResult classc) All of the mentionedd) None of the mentionedAnswer: cExplanation: A TransactionTemplate can accept a transaction callback object that implements either the TransactionCallback or an instance of the one implementer of that interface provided by the framework, the TransactionCallbackWithoutResult class. 14. Spring (since version 2.0) offers a transaction advice that can be easily configured via the:-a) rx:adviceb) bx:advice |
C. | All of the mentionedd) None of the mentionedAnswer: cExplanation: A TransactionTemplate can accept a transaction callback object that implements either the TransactionCallback or an instance of the one implementer of that interface provided by the framework, the TransactionCallbackWithoutResult class. 14. Spring (since version 2.0) offers a transaction advice that can be easily configured via the:-a) rx:adviceb) bx:advicec) tx:advice |
D. | None of the mentionedAnswer: cExplanation: A TransactionTemplate can accept a transaction callback object that implements either the TransactionCallback or an instance of the one implementer of that interface provided by the framework, the TransactionCallbackWithoutResult class. 14. Spring (since version 2.0) offers a transaction advice that can be easily configured via the:-a) rx:adviceb) bx:advicec) tx:adviced) none of the mentionedAnswer: cExplanation: This advice can be enabled with the AOP configuration facilities defined in the aop saop schema. 15. You can omit the transaction-manager attribute in the element if your transaction manager has the name transactionManager.a) Trueb) FalseAnswer: aExplanation: This element will automatically detect a transaction manager with this name. You have to specify a transaction manager only when it has a different name.Sanfoundry Global Education & Learning Series – Java Spring.To practice all areas of Java Spring, here is complete set of 1000+ Multiple Choice Questions and Answers.Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | PinterestYoutube | LinkedIn | Instagram | Facebook | Twitter | Pinterest« Prev - Spring Questions and Answers – Hibernate and JPA Contextual Sessions» Next - Spring Questions and Answers – Setting the Transaction Attribute |
Answer» B. FalseAnswer: aExplanation: In this way, you don’t need to repeat the boilerplate transaction management code for this block. 13. A TransactionTemplate can accept a transaction callback object that implements:-a) TransactionCallbackb) TransactionCallbackWithoutResult classc) All of the mentionedd) None of the mentionedAnswer: cExplanation: A TransactionTemplate can accept a transaction callback object that implements either the TransactionCallback or an instance of the one implementer of that interface provided by the framework, the TransactionCallbackWithoutResult class. 14. Spring (since version 2.0) offers a transaction advice that can be easily configured via the:-a) rx:adviceb) bx:advice | |
2. |
To help you control the overall transaction management process and transaction exception handling. |
A. | SpringTransactionTemplate |
B. | TransactionTemplate |
C. | Transaction |
D. | None of the mentioned |
Answer» C. Transaction | |
3. |
Method to start a new transaction with that definition:- |
A. | getTransaction() |
B. | commit() |
C. | rollback() |
D. | none of the mentioned |
Answer» B. commit() | |
4. |
PlatformTransactionManager is an abstract unit for transaction management. |
A. | True |
B. | False |
Answer» B. False | |
5. |
Method that allows you to start a new transaction (or obtain the currently active transaction). |
A. | getTransaction() |
B. | commit() |
C. | rollback() |
D. | all of the mentioned |
Answer» B. commit() | |
6. |
Spring’s core transaction management abstraction is based on the interface:- |
A. | PlatformTransaction |
B. | PlatformTransactionManager |
C. | TransactionManager |
D. | PlatformManager |
Answer» C. TransactionManager | |
7. |
Spring’s transaction support offers a set of technology-independent facilities, including transaction managers. |
A. | org.springframework.transaction.PlatformTransactionManager |
B. | org.springframework.transaction.support.TransactionTemplate |
C. | all of the mentioned |
D. | none of the mentioned |
Answer» D. none of the mentioned | |
8. |
PLATFORMTRANSACTIONMANAGER_IS_AN_ABSTRACT_UNIT_FOR_TRANSACTION_MANAGEMENT.?$ |
A. | True |
B. | False |
Answer» B. False | |
9. |
To help you control the overall transaction management process and transaction exception handling.$ |
A. | SpringTransactionTemplate |
B. | TransactionTemplate |
C. | Transaction |
D. | None of the mentioned |
Answer» C. Transaction | |
10. |
Method_to_start_a_new_transaction_with_that_definition:-$ |
A. | getTransaction() |
B. | commit() |
C. | rollback() |
D. | none of the mentioned |
Answer» B. commit() | |
11. |
Method that allows you to start a new transaction (or obtain the currently active transaction)? |
A. | getTransaction() |
B. | commit() |
C. | rollback() |
D. | all of the mentioned |
Answer» B. commit() | |
12. |
A transaction manager is declared in the Spring IoC container as a normal bean. |
A. | True |
B. | False |
Answer» B. False | |
13. |
Spring has several built-in implementations of PlatformTransactionManager interface for use with different transaction management APIs. |
A. | True |
B. | False |
Answer» B. False | |
14. |
The PlatformTransactionManager interface provides methods for working with transactions: |
A. | getTransaction(TransactionDefinition definition) |
B. | commit(TransactionStatus status) |
C. | rollback(TransactionStatus status) |
D. | all of the mentioned |
Answer» E. | |
15. |
Spring’s core transaction management abstraction is based on the interface:-$ |
A. | PlatformTransaction |
B. | PlatformTransactionManager |
C. | TransactionManager |
D. | PlatformManager |
Answer» C. TransactionManager | |
16. |
Spring’s transaction support offers a set of technology-independent facilities, including transaction managers.$ |
A. | org.springframework.transaction.PlatformTransactionManager |
B. | org.springframework.transaction.support.TransactionTemplate |
C. | all of the mentioned |
D. | none of the mentioned |
Answer» D. none of the mentioned | |
17. |
To access a database running on the Derby server, you have to add:- |
A. | Derby client library |
B. | Tomcat client library |
C. | All of the mentioned |
D. | None of the mentioned |
Answer» B. Tomcat client library | |
18. |
Transactions can be described with key properties:- |
A. | Atomicity |
B. | Consistency |
C. | Isolation |
D. | All of the mentioned |
Answer» E. | |