October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How One Spring Boot Default Killed an SSE Endpoint Under Load

A reported Spring Boot SSE incident traced connection-pool exhaustion to OSIV. Learn how to check the mechanism and audit transaction boundaries before disabling it.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In the incident described by Jo4 Team, the culprit was Spring Boot’s Open EntityManager in View setting: spring.jpa.open-in-view=true. The authors report that an open Server-Sent Events (SSE) response kept persistence state—and a database connection in their setup—alive for the stream’s duration. Enough open streams then exhausted the shared connection pool, stalling other database-backed requests. That is an account of one incident, not proof that every Spring Boot SSE endpoint behaves this way.

How an open SSE response can affect database connections

SSE delivers multiple server-to-client events over a response that stays open. Spring MVC provides SseEmitter for this pattern. In the incident account, the endpoint instead returned a Flux<ServerSentEvent<...>> and kept each stream open for 30 minutes, sending a heartbeat every 30 seconds. The authors say the stream also sent an initial unread count and live, in-memory updates. Jo4 Team’s September 21, 2026 account

As an Amazon Associate I earn from qualifying purchases.

The reported mechanism was request-lifetime persistence context behavior. The article says Open EntityManager in View (OSIV) kept the Hibernate session open until the response was fully written, and that a Hikari connection remained borrowed through it. With a long-running response, the time a connection was unavailable for other work could therefore extend far beyond the database operation that produced an event. This is the authors’ explanation of their setup; the article does not identify the framework, Hibernate, HikariCP, driver, database, or container versions needed to generalize it.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why the incident affected routes beyond SSE

The authors describe a Hikari pool with a maximum size of 10. In their example, ten open SSE tabs used all ten connections, so another request needing the same pool had to wait; the account gives a 30-second connection-acquisition timeout. Those figures describe the reported example, not universal defaults for current HikariCP applications. Check the actual pool size and timeout configured for your application.

When an endpoint monopolizes a shared database pool, the impact need not stay on that route: any database-backed endpoint that needs a connection from the same pool may queue or fail to acquire one. The incident article reports that wider effect, but it does not provide an independent benchmark or evidence about how commonly this failure occurs.

How to check whether this is your failure mode

Start by checking whether database connection demand rises with the number of open streams, and whether other routes using the same pool slow down at the same time. Then distinguish database-pool exhaustion from other streaming bottlenecks: the resource that is depleted matters.

Possible bottleneck What is constrained Useful distinction
Persistence context and database pool Database connections In the incident account, open SSE streams coincided with the shared pool running out of available connections and unrelated database-backed requests stalling.
Servlet-stack streaming writes Async executor capacity Spring’s reference says Servlet response writes for reactive streaming remain blocking and use a configured AsyncTaskExecutor. It warns that the default executor for streaming reactive types and Callable execution is not suitable for production under load. This is a separate capacity issue, not the OSIV cause asserted in the incident. Spring Framework: Asynchronous Requests
Async request timeout Time allowed for asynchronous processing Spring’s reference says the timeout depends on the Servlet container when not explicitly set. A timeout is not, by itself, evidence of database-pool exhaustion. Spring Framework: Asynchronous Requests
Network or client interruption Connection between client and server A proxy idle timeout or client disconnect can end a stream without establishing that the database pool or executor is exhausted.

Look at the timing and scope of the symptoms: whether they track open streams, affect other routes, or instead coincide with a stream ending or a processing timeout. Pool metrics can help establish whether connections are unavailable, but the incident account does not identify a particular monitoring product.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When disabling OSIV is appropriate—and what to audit first

The incident authors propose setting spring.jpa.open-in-view=false. That change is not a safe blind switch: first confirm that each database access runs within an explicit transaction and that event creation does not depend on lazy-loaded state after the transaction ends.

  1. Review the SSE request path and every later event producer for database access. An initial event and subsequent updates may follow different code paths.
  2. Ensure each required JPA read happens within an explicit transaction.
  3. Convert the data needed by the stream into DTOs or other detached values before leaving that transaction. Do not rely on later event production traversing lazy relationships.
  4. Only then disable OSIV with spring.jpa.open-in-view=false, and verify that both the SSE flow and ordinary database-backed routes still work.

This addresses the persistence-lifetime risk described in the incident. It does not configure the Servlet async executor or determine an appropriate request timeout; assess those separately if the application uses Spring MVC reactive streaming.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What the reported numbers do—and do not—show

Jo4 Team’s account gives a 30-minute stream, a 30-second heartbeat interval, a pool maximum of 10 connections, and a 30-second acquisition timeout for its example. It does not establish that these values are defaults across Spring Boot or HikariCP versions, nor does it establish how frequently OSIV causes SSE incidents. Treat them as details of that account, and compare them with your own application’s configuration.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.