Refreshing page with multiple StreamResources causes steady increase of pool size

Description

Description:
In a project that has a running database connection, when multiple images are loaded onto a page via StreamResources, every time the page refreshes, new connections are opened and old ones are not closed. This leads to the pool size getting maxed out, until no more connections can be opened, causing problems in the application.

The more images are loaded via StreamResources, the more connections are opened. This needs to be done in quick succession, if the StreamResource calls are slowly debugged, the connections are properly managed and the problem does not occur.

Steps to Reproduce:

  • Open attached project

  • Fix PIC_PATH inside MainLayout.java (folder is included in the project's root directory)

  • Run on server

  • Press F5 ~5 times

Environment

None

Activity

Show:
MS
March 2, 2021, 6:47 AM

Now I can refresh the page as many times as I want without problems.

Jonas
February 24, 2021, 9:45 AM

after upgrading the project to 1.04 i get the same issue like
and can’t test it.

FH
February 16, 2021, 10:45 AM

Fixed this issue by adding lazy initialization for the EntityManager to the per-request session strategy. This means that the EntityManager is only created on demand, and not on every request made to the server application. This should increase performance over all for the framework.

Fixed

Assignee

FH

Reporter

MS

Labels

None

Sprint

Fix versions

Affects versions

Priority

Critical