In a Spring Boot application, the _____ annotation is used to demarcate transaction boundaries.
- @Autowired
- @Component
- @Service
- @Transactional
In a Spring Boot application, the @Transactional annotation is used to demarcate transaction boundaries. It is applied to methods, indicating that the method should be wrapped in a transaction, ensuring that either all operations within the method succeed or none of them do. This is crucial for maintaining data consistency in the database.
Loading...
Related Quiz
- In reactive programming with Spring Boot, how can you handle errors in a reactive stream?
- To configure the cache storage type, like in-memory or external, in Spring Boot, the _____ property is used.
- The _____ annotation is used to mark the main class of a Spring Boot application.
- You have a requirement to validate an object graph with nested objects and associations using JSR-303 Bean Validation. How would you achieve this, ensuring that the entire object graph is validated?
- Which of the following annotations can be used to customize the response body in a Spring Boot application?