Can Spring Webflow 2.0 entity management capture from substream states?

My team and I are currently running a project using Spring 2.5.6 and Spring Webflow 2.0 (JDK 1.4.2). We are in the design phase right now and I would like to know if Spring Persistence context / entity (we are going to use Hibernate) can commit from subtones.

The commit attribute is only available from the final state. So, if we have a stream like this:

<flow>
<persistence-context />
<!-- Do some things -->
<!-- Call a subflow.  This hopefully will commit stuff. -->
<subflow-state id="foo">
</subflow-state>
<!-- Do some more things -->
<end-state id="theEnd" commit="true" />
</flow>

<!-- The Subflow -->
<flow>
<persistence-context />
<!-- Do some things -->
<!-- Do some more things -->
<end-state id="theEnd" commit="true" />
</flow>

      

We would like the sub-thread to be able to execute its steps before the parent thread is fully executed. Hope this is possible.

Will the substream be able to make transactions? Or will the web thread disallow this and only let the true parent thread be passed to the database with its entity / persistence management context?

0


source to share


1 answer


So the answer is yes and no. A sub-thread actually allocates a different persistence context than its parent, and it can use that persistence context to commit, but if the technology being used is Hibernate, objects must be bound to its session before issuing the final commit state.



0


source







All Articles