Lazy Loading in Hibernate: How It Works and Common Pitfalls
Hibernate lazy loading defers fetching associations until you use them. See default fetch types, LazyInitializationException fixes and how to avoid N+1 queries.
2,889 posts about Java: questions with answers, tutorials and articles, newest first.
Hibernate lazy loading defers fetching associations until you use them. See default fetch types, LazyInitializationException fixes and how to avoid N+1 queries.
@Entity marks a Java class as a persistent type that Hibernate maps to a table row. This guide covers the rules, naming and mistakes.
Hibernate is an ORM layer that runs on top of JDBC. See how the two relate, compare code side by side, and learn when plain JDBC is the better tool.
Connection pooling reuses open JDBC connections instead of creating one per request. Learn how it works and how to configure HikariCP and Spring Boot.
The main steps to connect to a database using JDBC: add the driver, open a Connection, run PreparedStatement queries, close resources, and use a connection pool.
Disable auto-commit, run statements on one connection, then commit or roll back. Includes savepoints, isolation levels and batching.
The ResultSet interface is how a Java program reads the rows a SQL query returns. See navigation, typed getters, updatable cursors, metadata and safe cleanup.
DriverManager is the JDBC class that selects a registered driver and opens a Connection from a JDBC URL. It does no pooling, so production code uses a DataSource.
Go beyond a single query with JDBC: pooled connections, PreparedStatement, batching, transactions and stored procedures in current Java.
JDBC is the standard Java API for connecting to relational databases. Learn drivers, connections, PreparedStatement, transactions, batching and connection pooling.
JMS publish/subscribe sends each message to every subscription on a topic. Learn durable and shared subscriptions with working Jakarta Messaging code.
JMS offers point-to-point messaging with queues and publish-subscribe with topics. Learn how each works and how to choose between them.
Write a Java message-driven bean that consumes JMS messages, and see when to use Spring @JmsListener instead of a Jakarta EE server.
JMS is the Java API for sending and receiving messages through a broker. Learn queues, topics, reliability and the modern jakarta.jms package.
RESTful services are simple, stateless and cacheable, and work with any client. See the advantages, a Spring Boot example and the limits.
REST uses HTTP resources and JSON; SOAP uses XML envelopes and WSDL contracts. Compare them and learn when each fits.
WSDL is the machine-readable XML contract of a SOAP web service. See its structure, an example, code generation and how it compares to OpenAPI.
Build and publish a SOAP web service in Java with Jakarta XML Web Services, the Metro runtime and Endpoint.publish, then call it from a Java client.
JAX-WS, now Jakarta XML Web Services, builds and calls SOAP services from annotated Java classes. See a working example and what changed since Java 11.
JAX-RS, now Jakarta REST, is the standard Java API for REST services. See annotations, a full resource example, providers, and the javax to jakarta change.