| Ko

JPA Lazy Loading vs Eager Loading Performance

History and Necessity of Loading Strategies ORM (Object-Relational Mapping) frameworks emerged to solve the impedance mismatch between object-oriented programming and relational databases. During this process, how to efficiently load entities with associations became a critical challenge. Early ORM implementations used immediate loading for all associated entities, which caused performance degradation by loading unnecessary data into memory. Hibernate introduced a proxy-based lazy loading mechanism to solve this problem. Hibernate has continuously improved loading strategies since its initial release in 2001. While early versions only supported simple lazy loading, later versions added various optimization techniques such as fetch join, batch fetching, and subselect fetching. These features were included in the JPA (Java Persistence API) 1.0 standard when it was released in 2006. Through JPA 2.0 (2009) and JPA 2.1 (2013), declarative fetch strategies like @EntityGraph were added, enabling more sophisticated control over associated entity loading. Today, the JPA standard and Hibernate implementation continue to evolve together, providing developers with various options. ...

June 8, 2024 · 8 min · 1688 words · In-Jun

Understanding JPA Entity Lifecycle

What the Entity Lifecycle Is In JPA (Java Persistence API), the entity lifecycle describes the state changes an entity object goes through from creation to deletion. The concept was defined in the JPA 1.0 specification released with Java EE 5 in 2006, built around the persistence context and influenced by Hibernate’s Session model. Entities are classified into four states based on whether the persistence context manages them and how they are synchronized with the database: Transient, Managed, Detached, and Removed. They move between these states through EntityManager methods such as persist(), merge(), detach(), and remove(). ...

June 8, 2024 · 9 min · 1828 words · In-Jun

JPA EntityManager

History and Concept of EntityManager EntityManager is the core interface of the Java Persistence API (JPA), first defined in the EJB 3.0 specification released as part of JSR 220 in 2006. It was designed to standardize Hibernate’s Session interface and provide a vendor-independent persistence management API. The Session concept, introduced by Gavin King in 2001 during Hibernate’s development, was an innovative approach that abstracted database connections and tracked entity state. JPA standardized this idea, reformulated it as EntityManager, and enabled the same interface to be used across all JPA implementations (Hibernate, EclipseLink, OpenJPA). ...

June 7, 2024 · 8 min · 1574 words · In-Jun

Spring Data JPA vs. JPA Key Differences

JPA’s Origins and History JPA (Java Persistence API) was first announced on May 11, 2006, through Java Community Process JSR 220 as part of the EJB 3.0 specification. It standardized many of Hibernate’s core concepts to address the complexity, heavy structure, and container dependency of EJB 2.x Entity Beans. Those beans required a Home Interface, Remote Interface, and Bean Class, along with complex XML descriptors. That overhead hurt development productivity and made testing difficult. ...

June 7, 2024 · 8 min · 1607 words · In-Jun

Namespaces and Cgroups in Docker

Linux container technology has steadily evolved since mount namespaces first appeared in kernel 2.4.19 in 2002. Namespaces provide process isolation, while Cgroups (Control Groups) provide resource control. Together, they form a core foundation of modern cloud infrastructure. Container runtimes such as Docker, Kubernetes, and Podman rely on these two kernel features to provide isolation that is much lighter and faster than virtual machines, and understanding them is the first step toward a deeper grasp of container technology. ...

June 5, 2024 · 8 min · 1555 words · In-Jun

MVC Pattern

The Birth of the MVC Pattern and Historical Context The MVC pattern was first conceived in 1979 by Norwegian computer scientist Trygve Reenskaug while working on the Smalltalk-76 project at Xerox PARC (Palo Alto Research Center). This was part of a revolutionary effort to advance graphical user interfaces during the dawn of personal computing. Xerox PARC pioneered many modern computing concepts, including Ethernet, laser printers, and object-oriented programming. Reenskaug was exploring ways for users to effectively control and visualize complex data structures when he conceived the idea of separating data (Model), presentation (View), and control (Controller). ...

June 5, 2024 · 7 min · 1358 words · In-Jun

Understanding HTTP Status Codes

HTTP status codes are standardized three-digit response codes that a server returns to indicate the result of processing a client’s request. These codes play a crucial role in HTTP-based communication for web browsers, API clients, and search engines by showing whether a request succeeds, requires redirection, or fails with a client-side or server-side error. In RESTful API design, choosing the right status codes has a major impact on API clarity and developer experience. ...

June 5, 2024 · 18 min · 3712 words · In-Jun

Spring MVC DispatcherServlet

What Is DispatcherServlet? DispatcherServlet is the core component of Spring MVC that implements the Front Controller pattern. It receives HTTP requests at a single entry point, delegates them to the appropriate controllers, and renders the results into views for the response. This centralizes common logic and lets developers focus on business logic. History and Evolution of DispatcherServlet Spring MVC emerged in 2004 with Spring Framework 1.0, establishing itself as a web framework with DispatcherServlet implementing the Front Controller pattern as an alternative to the complex servlet development approach of J2EE at that time. Initially, servlets were registered and mapped through XML-based configuration. Since Servlet 3.0 and above, Java configuration became possible through WebApplicationInitializer. With the advent of Spring Boot, auto-configuration was introduced, allowing developers to use it immediately without separate configuration. ...

June 5, 2024 · 8 min · 1646 words · In-Jun

Spring Interceptor

Spring Interceptor Basics and History Spring Interceptor is a feature first introduced in Spring Framework 2.0 in 2006. It is a mechanism that intervenes at key points—before and after controller execution and after view rendering completion—in the MVC architecture to perform common functions. Through the three methods of the HandlerInterceptor interface (preHandle, postHandle, and afterCompletion), it handles request preprocessing and postprocessing. The design separates cross-cutting concerns such as authentication, logging, execution time measurement, and common data setup from business logic. ...

June 4, 2024 · 6 min · 1250 words · In-Jun

Servlet Filter

Servlet Filter Basics and History A servlet filter is a Java component introduced in the Servlet 2.3 specification in 2001. It intercepts HTTP requests before servlets handle them and responses before they are returned to clients, making it useful for preprocessing and postprocessing tasks. This makes it easier to implement cross-cutting concerns such as authentication, logging, character encoding, and data compression in a reusable way separate from business logic. Filters are based on the Chain of Responsibility design pattern, so multiple filters can be linked together and executed in sequence. ...

June 4, 2024 · 6 min · 1116 words · In-Jun
[email protected]