Câu hỏi phỏng vấn Spring
Câu hỏi

What are the types of the transaction management Spring supports?

Câu trả lời

Spring Framework supports two primary types of transaction management: Programmatic Transaction Management and Declarative Transaction Management.

Programmatic Transaction Management

In programmatic transaction management, transactions are managed with programming within the business logic. Here, developers explicitly write the code to manage the transaction lifecycle using the TransactionTemplate or managing the transaction status through the PlatformTransactionManager interface. This approach provides a high degree of control over transactions but requires more boilerplate code and is harder to maintain[1][4].

Declarative Transaction Management

Declarative transaction management, on the other hand, allows you to manage transactions without writing any specific code to handle transactional states. Instead, you declare the transactional rules using annotations or XML configuration, and the Spring Framework takes care of applying these rules to the business logic. The most common way to implement declarative transaction management in Spring is using the @Transactional annotation. This method separates transaction management from the business logic, makin...

middle

middle

Gợi ý câu hỏi phỏng vấn

senior

How is an incoming request mapped to a controller and mapped to a method?

senior

What is Weaving in Spring?

senior

What are Aspect, Advice, Pointcut, and JoinPoint in AOP?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào