Spring Data Mongodb Cross store:: With MySQL @RelatedDocument(s) not updating
===

I am using Spring Data Mongodb and Spring data JPA module for MySQL.

I have successfully configured as suggested in the reference document.
I am able to save but not able to update the mongodb "RelatedDocuments"

The relationship is like User(Mysql) has Adresses(Mongo) > Has list of address (quite similar to the survey example in reference.

My situation is exactly similar to http://forum.springsource.org/showthread.php?124645-Questions-about-Cross-store-support


The versions I am using are as follows

	spring-data.mongodb.version = 1.1.0.M1
	spring.version = 3.1.2.RELEASE
        spring.data.jpa.version = 1.1.0.RELEASE

	hibernate.entitymanager.version = 4.1.4.Final
	hibernate.jpa-api.version = 1.0.1.Final (using JPA 2.0)

        aspectj.version = 1.6.12


Please could somebody point out what I might be missing, config files are as below



	<!-- Activate Spring Data JPA repository support -->
	<jpa:repositories base-package="com.domain.domain.*.repo" factory-class="com.mydomainit.domain.repo.BaseJpaRepositoryFactoryBean"/>

  <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
		<property name="driverClassName" value="com.mysql.jdbc.Driver" />
		<property name="url" value="${app.jdbc.url}" />
		<property name="username" value="${app.jdbc.username}" />
		<property name="password" value="${app.jdbc.password}" />
	</bean>

	<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" p:persistenceXmlLocation="classpath*:META-INF/persistence.xml"
		p:persistenceUnitName="spring-jpa" p:dataSource-ref="dataSource" p:jpaVendorAdapter-ref="hibernateVendor" />

	<bean id="hibernateVendor" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" p:showSql="true" p:generateDdl="false"
		p:database="MYSQL" />

	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" p:entityManagerFactory-ref="entityManagerFactory" />

	<tx:annotation-driven mode="aspectj" transaction-manager="transactionManager" />
	
  <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />

  <bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />



The MongoDB config is as below

	<mongo:repositories base-package="com.domain.*.mongorepo" repository-impl-postfix="CustomImpl"
		factory-class="com.domain.mongorepo.CommonMongoRepoFactoryBean" />

	<mongo:mongo id="mongoRef" host="${mongo.host.name}" port="${mongo.host.port}">
		<mongo:options connections-per-host="8" threads-allowed-to-block-for-connection-multiplier="4" connect-timeout="1000" max-wait-time="1500"
			auto-connect-retry="true" socket-keep-alive="true" socket-timeout="1500" slave-ok="true" write-number="${mongo.db.w}" write-timeout="${mongo.db.wtimeout}"
			write-fsync="${mongo.db.fsync}" />
	</mongo:mongo>

	<mongo:db-factory id="mongoDbFactory" dbname="${mongo.db.name}" username="${mongo.db.username}" password="${mongo.db.password}"
		mongo-ref="mongoRef" />

	<bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate" c:mongoDbFactory-ref="mongoDbFactory" c:mongoConverter-ref="mappingConverter" />

	<bean class="org.springframework.data.mongodb.crossstore.MongoDocumentBacking" factory-method="aspectOf">
		<property name="changeSetPersister" ref="mongoChangeSetPersister" />
	</bean>
	<bean id="mongoChangeSetPersister" class="org.springframework.data.mongodb.crossstore.MongoChangeSetPersister">
		<property name="mongoTemplate" ref="mongoTemplate" />
		<property name="entityManagerFactory" ref="entityManagerFactory" />
	</bean>

	<bean class="org.springframework.data.mongodb.core.MongoExceptionTranslator" />
	