Project

General

Profile

Actions

bug #7046

closed

replace open session per view pattern by DTO strategy

Added by Andreas Kohlbecker over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Highest
Category:
cdm-vaadin
Target version:
Start date:
Due date:
% Done:

40%

Estimated time:
Severity:
critical
Found in Version:

Description

In #6687 the open session per view pattern has been implemented for the cdm-vaadin mvp framework.

It turned out that this approach is causing problems since a session opened in one view needs to be reused in multiple request threads. In order to accomplish this it is always required to have a transaction open for the whole lifetime of the view which causes an open database connection for the same time. The database connection pool is limited to a maximum amount of open connections and can thus run out of available connections when too many views are opened at the same time. This situation is becoming worse if vaadin views are not destroyed fast enough so that the resource are being freed quickly (#7047).

As explained in VaadinNotes the best way to avoid LazyInitializytionExceptions is to use DTOs or entity bean initialization strategies. This will not only allow to free database connections as quickly as possible but also avoids managing long transactions logs at in the database itself.

TODO:

  • remove all open session per view pattern code
  • use bean init-strategies to avoid LazyInitializytionExceptions
  • in order to save edited entities, open a new clean session, merge the modified entity and flush and commit
    • In future we may want to check for intermediate modifications of the entity by other users. I case a modification by someone else is detected the application will present a dialog to inform the user that someone else work will be overwritten. The dialog should present a table of all conflicting properties allowing the user to resolve the conflict. #7050

Related issues

Related to EDIT - bug #6687: Multiple representations of the same entity merge problemClosedAndreas Kohlbecker

Actions
Related to EDIT - bug #7047: Vaadin UI and View scope beans are not always destroyed correctlyClosedAndreas Kohlbecker

Actions
Related to EDIT - bug #7036: correctly release vaadin view resources when the browser windows has been closedClosedAndreas Kohlbecker

Actions
Actions #1

Updated by Andreas Kohlbecker over 6 years ago

  • Description updated (diff)
Actions #2

Updated by Andreas Kohlbecker over 6 years ago

  • Related to bug #6687: Multiple representations of the same entity merge problem added
Actions #3

Updated by Andreas Kohlbecker over 6 years ago

  • Description updated (diff)
Actions #4

Updated by Andreas Kohlbecker over 6 years ago

  • Related to bug #7047: Vaadin UI and View scope beans are not always destroyed correctly added
Actions #5

Updated by Andreas Kohlbecker over 6 years ago

  • Related to bug #7036: correctly release vaadin view resources when the browser windows has been closed added
Actions #6

Updated by Andreas Kohlbecker over 6 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 40
Actions #7

Updated by Andreas Kohlbecker over 6 years ago

  • Description updated (diff)
  • Status changed from In Progress to Resolved
  • Assignee changed from Andreas Kohlbecker to Fabian Reimeier

@Fabian: The refactoring is completed now. can you please do an in depth check on the distribution editor to confirm that nothing has been broke by these commits? All changes are in a feature branch which will be merged to develop once we know that there are no problems.

Actions #8

Updated by Andreas Kohlbecker over 6 years ago

Andreas Kohlbecker wrote:

@Fabian: The refactoring is completed now. can you please do an in depth check on the distribution editor to confirm that nothing has been broke by these commits? All changes are in a feature branch which will be merged to develop once we know that there are no problems.

I fixed some remaining problems and did a fast forward merge of the feature branch into develop. So you can test on develop directly.

Actions #9

Updated by Andreas Müller over 6 years ago

I have tested the distribution app intensively and couldn't find an problem, especially no LIE. Even after logout and login again. So maybe we can close this ticket.

Actions #10

Updated by Andreas Kohlbecker over 6 years ago

  • Status changed from Resolved to Closed
  • Assignee changed from Fabian Reimeier to Andreas Kohlbecker

Great thank you for this confirmation, i also could not produce any error. So i am closing this ticket now.

Actions

Also available in: Atom PDF