hi all....
I have an application that is not performing updates/creates. I'm utilizing Spring WebFlow and have annotated my service with the @Transactional annotation. I'm able to read data no problem. No exceptions are being thrown. I'm not using persistence-context within my flow. Looking at the logging, all the sql selects are being issued correct, but no updates/creates.
SWF Version is 2.0.8.
Spring Version is 2.5.6.
If someone can point me in the right direction, it would be very helpful. here's my config:
Service Method
Data Access Config:Code:@Transactional public void updateUser(String id) { User user = this.find(new Integer(id)); java.util.Calendar loginDate = java.util.Calendar.getInstance(); loginDate.setTime(new java.util.Date()); user.setLastLoginDate(loginDate); em.merge(user); }
My web flow config (revelent part):Code:<!-- Turn on AspectJ @Configurable support --> <context:spring-configured/> <!-- Instructs Spring to perfrom declarative transaction management on annotated classes --> <tx:annotation-driven mode="aspectj" transaction-manager="transactionManager"/> <!-- Drives transactions using local JPA APIs --> <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory" /> </bean> <!-- Creates a EntityManagerFactory for use with the Hibernate JPA provider and a simple in-memory data source populated with test data --> <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="jpaVendorAdapter"> <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" /> </property> </bean>
If I call entityManager.flush() from within my service method (updateUser above), an exception is thrown saying 'no transaction is in progress'.Code:<!-- Installs a listener that manages JPA persistence contexts for flows that require them --> <bean id="jpaFlowExecutionListener" class="org.springframework.webflow.persistence.JpaFlowExecutionListener"> <constructor-arg ref="entityManagerFactory" /> <constructor-arg ref="transactionManager" /> </bean>
I also tried loading the user within my flow my making a call '<evaluate expression....result=flowScope.applicationUser'/>, then calling <evaluate expression...userService.merge(applicationUser) but no luck there either.
any help is appreciated...
thanks


Reply With Quote