Loading

Quipoin Menu

Learn • Practice • Grow

spring / Transaction Management
mcq
Direction: Choose the correct option

Q1.

What is transaction management in Spring?
A. Managing database transactions declaratively or programmatically
B. A way to handle money
C. A security feature
D. None
Direction: Choose the correct option

Q2.

Which annotation is used for declarative transaction management?
A. @Transactional
B. @Transaction
C. @Tx
D. @TransactionalManager
Direction: Choose the correct option

Q3.

What does @Transactional(propagation = Propagation.REQUIRED) mean?
A. Support a current transaction; create a new one if none exists
B. Always create a new transaction
C. Run non-transactionally
D. None
Direction: Choose the correct option

Q4.

What is the isolation level in transactions?
A. Defines how transaction changes are visible to others
B. Defines transaction boundary
C. Defines propagation
D. None
Direction: Choose the correct option

Q5.

What does @Transactional(readOnly = true) do?
A. Optimizes for read operations (no flush, possible performance gain)
B. Prevents writes
C. Marks transaction as read-only
D. All of the above
Direction: Choose the correct option

Q6.

What is the rollback policy of @Transactional by default?
A. Rollback on RuntimeException and Error, not on checked exceptions
B. Rollback on any exception
C. Rollback only on checked
D. No rollback
Direction: Choose the correct option

Q7.

How do you specify a custom rollback rule?
A. rollbackFor = Exception.class
B. noRollbackFor = ...
C. Both A and B
D. None
Direction: Choose the correct option

Q8.

What is the PlatformTransactionManager in Spring?
A. Central interface for managing transactions
B. A specific transaction manager
C. A JTA manager
D. None
Direction: Choose the correct option

Q9.

Which transaction manager is commonly used with JPA?
A. JpaTransactionManager
B. DataSourceTransactionManager
C. HibernateTransactionManager
D. All
Direction: Choose the correct option

Q10.

How do you enable transaction management in Spring?
A. @EnableTransactionManagement
B. <tx:annotation-driven/>
C. Both A and B
D. None