The Online Part of RAG
The second half of RAG: retrieve the right chunks, ground the prompt in them, and let DeepSeek answer - or honestly say 'I don't know' when the context is silent.
Topic
Framework behaviour that only shows up when you push on it — validation, migrations, batch, aggregate boundaries, events that outlive the request, and the Spring AI plumbing that fills a vector store and queries it back.
The second half of RAG: retrieve the right chunks, ground the prompt in them, and let DeepSeek answer - or honestly say 'I don't know' when the context is silent.
RAG has two halves, and only one uses a language model. A walkthrough of the other one - read, chunk, embed, index - built with Spring AI, pgvector and Ollama.
What @TransactionalEventListener actually fires on commit, on rollback, and on neither -- plus a write inside AFTER_COMMIT that survives or vanishes depending on your connection pool. Measured in a playground, not quoted from the Javadoc.
Spring's plain @EventListener runs on your thread, inside your transaction, before your next line — and a chained event is fully handled before the original finishes. Everything here was verified by running it, not by reading the reference page.
A fire-and-forget @Async listener turns every SMTP hiccup into a lost message. Here is how @TransactionalEventListener plus an event publication table makes it durable — and the four ways that setup silently does nothing.
Spring Data JDBC takes DDD aggregates literally. Here's a one-question rule for drawing aggregate boundaries — and how to avoid N+1 once you have them, verified against the real generated SQL.
A code-forward tour of Spring Batch 6 on Spring Boot 4 and Java 25 — the resourceless repository, the new ChunkOrientedStep engine, Spring Framework 7 retry, the CommandLineJobOperator, and how stop and recover actually work under the hood.
Wiring Flyway into a Spring Boot 4.1 / Java 25 app with a Docker-Compose Postgres - including the Boot 4 auto-config modularization gotcha that makes a missing starter look exactly like a missing library.
Three validation mechanisms wear one annotation vocabulary in Spring MVC. Only one hands you a ConstraintViolationException — the rest give you Spring's own web exceptions. Here's the map, with live proof.