Results 1 to 2 of 2

Thread: Spring Data Jpa breaks JpaFlowContextPersistence

Hybrid View

  1. #1
    Join Date
    Apr 2008
    Posts
    22

    Exclamation Spring Data Jpa breaks JpaFlowContextPersistence

    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:

    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" />
    On test transition, the model is persisted into the database. Just remove:
    <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
    Joćo Simas
    Software Engineer @ Glintt

  2. #2
    Join Date
    Apr 2008
    Posts
    22

    Default

    Joćo Simas
    Software Engineer @ Glintt

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •