Tag

Object Escape

1 views collected around this technical thread.

Cognitive Technology Team
Cognitive Technology Team
Apr 19, 2025 · Backend Development

Concurrency Risks of Object Escape in Spring AOP and Correct Advice Ordering

The article explains how Spring AOP can cause object escape leading to concurrency safety problems, describes the impact of asynchronous threads and caching, and provides practical guidance on ordering AOP advices such as distributed lock, @Retryable, and dynamic datasource to avoid business anomalies.

AOPDistributed LockObject Escape
0 likes · 5 min read
Concurrency Risks of Object Escape in Spring AOP and Correct Advice Ordering
Cognitive Technology Team
Cognitive Technology Team
May 21, 2023 · Backend Development

Concurrency Safety Issues Caused by AOP Object Escape and Incorrect Advice Order in Spring

This article explains how improper use of AOP in Spring can cause object escape leading to concurrency safety problems, discusses issues such as asynchronous thread modifications, caching, and incorrect advice ordering with @Transaction, @Retryable, and dynamic datasource switching, and provides practical guidance to avoid these pitfalls.

AOPJavaObject Escape
0 likes · 5 min read
Concurrency Safety Issues Caused by AOP Object Escape and Incorrect Advice Order in Spring