Tagged articles

Bean Scope

22 articles · Page 1 of 1
Coder Trainee
Coder Trainee
Jul 14, 2026 · Backend Development

Top 10 Must‑Know Spring Interview Questions for Java Developers

This article walks through the ten most frequently asked Spring interview topics—including IoC/DI concepts, bean lifecycle, AOP mechanics, circular‑dependency resolution, @Transactional behavior, Spring Boot startup steps, auto‑configuration, @Autowired vs @Resource, bean scopes, and the differences between servlet filters and Spring interceptors—providing concrete code examples and key points that can earn interviewers' extra credit.

AOPBean ScopeIoC
0 likes · 12 min read
Top 10 Must‑Know Spring Interview Questions for Java Developers
Java Tech Workshop
Java Tech Workshop
Jun 14, 2026 · Backend Development

Spring Bean Scopes: 5 Types, Common Pitfalls and Concurrency Gotchas

The article explains the five Spring Bean scopes, clarifies that scope only controls instance count and not thread safety, and walks through real‑world concurrency bugs such as mutable singleton fields, prototype beans losing their prototype nature, and request‑scoped beans failing in async threads, offering concrete fixes and usage recommendations.

Bean ScopeSpringconcurrency
0 likes · 10 min read
Spring Bean Scopes: 5 Types, Common Pitfalls and Concurrency Gotchas
Java One
Java One
Dec 12, 2025 · Backend Development

Understanding Spring Bean Scopes: When Singleton Becomes Prototype

This article explains how Spring manages bean instances, compares singleton and prototype scopes with concrete code examples, and shows why two injected beans may be equal or different depending on the @Scope annotation applied to the component class.

Bean Scopedependency injectionjava
0 likes · 3 min read
Understanding Spring Bean Scopes: When Singleton Becomes Prototype
Cognitive Technology Team
Cognitive Technology Team
Jul 7, 2025 · Backend Development

Master Spring Bean Scopes: Choose the Right Lifecycle for High‑Performance Apps

An in‑depth guide to Spring Bean scopes explains the seven standard scopes—including Singleton, Prototype, Request, Session, Application, Global Session, and WebSocket—detailing their lifecycles, configuration methods, core principles, and best‑practice scenarios to help developers choose the optimal scope for high‑performance, reliable applications.

Bean ScopeSpringbackend development
0 likes · 12 min read
Master Spring Bean Scopes: Choose the Right Lifecycle for High‑Performance Apps
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
May 23, 2024 · Backend Development

Spring Prototype Bean Injection: ServiceLocator vs ObjectFactoryCreating

This article explains how to define and inject prototype-scoped beans in Spring using @Scope, ServiceLocatorFactoryBean, and ObjectFactoryCreatingFactoryBean, demonstrates configuration via annotations and XML, shows code examples, compares the two FactoryBean approaches, and includes tips for bean name mapping and custom exceptions.

Bean ScopeObjectFactoryCreatingFactoryBeanServiceLocatorFactoryBean
0 likes · 9 min read
Spring Prototype Bean Injection: ServiceLocator vs ObjectFactoryCreating
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Jan 5, 2024 · Backend Development

Mastering Spring Bean Scopes: When to Use Singleton, Prototype, Request, Session, and More

This article explains Spring's bean scopes—including singleton, prototype, request, session, and application—detailing their lifecycles, appropriate use cases, and how to configure them with code examples, while also covering common pitfalls and proxy solutions for web environments.

Bean ScopeSpringdependency injection
0 likes · 10 min read
Mastering Spring Bean Scopes: When to Use Singleton, Prototype, Request, Session, and More
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Oct 16, 2023 · Backend Development

Master Spring Bean Injection: Prototype in Singleton, Lazy, Transactions & More

This guide explains how to handle various Spring bean injection and transaction challenges, including injecting prototype beans into singletons, using @Lazy, registering abstract beans, resolving multiple bean conflicts, forcing rollback without exceptions, injecting static fields, ensuring transaction consistency, enabling non‑public transactional methods, custom component scanning, and adding interfaces via AOP.

Bean ScopeSpringTransaction Management
0 likes · 12 min read
Master Spring Bean Injection: Prototype in Singleton, Lazy, Transactions & More
Code Ape Tech Column
Code Ape Tech Column
Sep 16, 2022 · Backend Development

Ensuring Thread Safety for Spring Singleton Beans: Problems and Solutions

This article explains why Spring singleton beans can be unsafe in concurrent scenarios, demonstrates the issue with a controller example, and presents multiple solutions including changing bean scope, using ThreadLocal, avoiding member variables, employing concurrent collections, and leveraging distributed caches.

Bean ScopeSpringThread Safety
0 likes · 8 min read
Ensuring Thread Safety for Spring Singleton Beans: Problems and Solutions
Java Architect Essentials
Java Architect Essentials
Nov 24, 2021 · Backend Development

Understanding Spring Bean Scopes: Singleton vs Prototype

This article explains the differences between Spring's singleton and prototype bean scopes, describing how singleton beans are cached and shared across requests while prototype beans are created anew each time, and discusses their performance advantages, thread‑safety drawbacks, and practical implications for developers.

Bean Scopebackendjava
0 likes · 5 min read
Understanding Spring Bean Scopes: Singleton vs Prototype
IT Xianyu
IT Xianyu
Nov 18, 2020 · Backend Development

Understanding Spring Framework: Core Concepts, Advantages, and Bean Management

This article provides a comprehensive overview of the Spring framework, explaining its IoC and AOP core, architectural layers, key advantages such as decoupling and declarative transactions, bean scopes, lifecycle settings, and practical object‑creation methods for Java backend development.

Bean ScopeIoCSpring
0 likes · 7 min read
Understanding Spring Framework: Core Concepts, Advantages, and Bean Management
Java Backend Technology
Java Backend Technology
Aug 18, 2020 · Backend Development

Why Spring Controllers Are Not Thread‑Safe and How to Fix Them

Spring MVC controllers are singleton by default, which can cause thread‑unsafe behavior when using non‑static member variables; this article demonstrates the issue with example endpoints, shows how prototype scope resolves it, and outlines best practices such as avoiding stateful fields or using ThreadLocal.

Bean ScopeControllerSpring
0 likes · 5 min read
Why Spring Controllers Are Not Thread‑Safe and How to Fix Them
Top Architect
Top Architect
Aug 6, 2020 · Backend Development

Understanding Spring Controller Bean Scope: Singleton vs Prototype and Thread Safety

This article explains why Spring MVC controllers are singleton by default, demonstrates the thread‑safety issues caused by shared instance variables, shows how to test the behavior with sample code, and presents solutions such as using prototype scope, avoiding member variables, or employing ThreadLocal.

Bean ScopeControllerSpring
0 likes · 6 min read
Understanding Spring Controller Bean Scope: Singleton vs Prototype and Thread Safety
Java Backend Technology
Java Backend Technology
Apr 23, 2020 · Backend Development

Why Spring’s Constructor Injection Fails on Circular Dependencies (and How Setters Help)

This article explains what circular dependencies are in Spring, shows three ways the framework handles them—constructor injection, singleton setter injection, and prototype setter injection—illustrates each with Java classes and XML configuration, and clarifies why only the singleton setter approach avoids runtime errors.

Bean ScopeCircular DependencyConstructor Injection
0 likes · 9 min read
Why Spring’s Constructor Injection Fails on Circular Dependencies (and How Setters Help)