spring-webflow icon indicating copy to clipboard operation
spring-webflow copied to clipboard

Open session in view [SWF-893]

Open spring-operator opened this issue 16 years ago • 1 comments

Andrey Petrenko opened SWF-893 and commented

Please provide XXXFlowExecutionListener that will work the same as OpenSessionInViewInterceptor, but close session after view rendering. Flows marked as <persistence-context/> it should walk around.

The reasons:

For now the only way to have open hibernate session in view with SWF is using flow managed persistence (<persistence-context/> tag).

OpenSessionInViewInterceptor allows only to have single session in flow controller, but in view it has no sence because of using Post+Redirect+Get pattern (there is a new http request for view rendering, so there is a new hibernate session). Even for this purpose (having single session in flow controllers for non <persistence-context> flows) is impossible because when there is at least one <persistence-context> flow, the application fails when entering this flow.

Marking all flows where I need open session in view as <persistence-context/> I can't beacuse there many issues appear.

See related forum thread http://forum.springframework.org/showthread.php?t=58645


Affects: 2.0.3

Issue Links:

  • #185 Flow managed persistence context propagation

19 votes, 17 watchers

spring-operator avatar Sep 17 '08 19:09 spring-operator

Rossen Stoyanchev commented

Linking to #185 as it seems much of the discussion around a view-level PersistenceContext ends up bringing up the limitation of not being able to re-use a PersistenceContext across subflows.

spring-operator avatar Oct 29 '10 03:10 spring-operator