Hello.
I've already posted a related thread about this (http://forum.springsource.org/showth...ery-view-state!), however i already found what the problem is:
Spring Data Jpa Repositories breaks JPA Flow Persistence.
The problem is that if i call directly a Jpa Repository in the flow, for some reason, the model entity is saved into the Database not following the JpaFlowExcution pattern.
So, if you have:
On test transition, the model is persisted into the database. Just remove:Code:<persistence-context /> <view-state id="edit" model="xpto"> <transition on="back" to="cancelEdit" bind="false" validate="false" /> <transition on="save" to="endSave"> <evaluate expression="xptoFlowService.save(xpto)" /> </transition> <transition on="test" to="edit"> <evaluate expression="xptoFlowService.someRandomMethod()" /> <evaluate expression="fooJpaRepository.count()" /> </transition> </view-state> <end-state id="cancelEdit" commit="false" /> <end-state id="endSave" commit="true" />
<evaluate expression="fooJpaRepository.count()" />
and everything runs as expected.
I'm really stuck in this issue, and i would be very thankfull if anyone could help me. If spring data jpa repositories cannot be used inside the Webflow, this will be a big pitfall and i will be forced to give up spring data jpa
I'm using Spring Data 1.1.0 with Spring Webflow 2.3.1 and JPA 2.0.
Thanks in advance.
Best Regards



Reply With Quote
