I'm trying to migrate from SDN 4.2
to SDN 5
and OGM 3
Everything almost works perfectly except one case.
Right now in order to save the entity I have to use depth=2 instead of depth=1 like at SDN 4.2
It's hard to explain there so I have created a demo project at GitHub that reproduces this issue - https://github.com/Artgit/spring-boot-2.0.0.M4-sdn5-ogm3-saving-issue
Steps to reproduce:
If you want to use your own Neo4j instance please skip step #1 and start reading from step #2.
Run
mvn docker:start -Dfile.encoding=UTF-8
in order to spin up Neo4j 3.2.5 in Docker container (Docker must be installed)Execute test
com.decisionwanted.domain.DecisionCharacteristicIT.testUpdateValue()
The test should fail with the assertion:
java.lang.AssertionError: expected:<BaseEntity [id=3, class=class com.decisionwanted.domain.model.user.User, createDate=Wed Oct 04 21:54:17 EEST 2017, updateDate=Wed Oct 04 21:54:17 EEST 2017]> but was:<BaseEntity [id=2, class=class com.decisionwanted.domain.model.user.User, createDate=Wed
As you can see from the following code:
rdbmsHorScalingValue = valueDao.update(rdbmsHorScalingValue, newStringValue2, newStringDescription2, user3,
null);
assertEquals(user3, rdbmsHorScalingValue.getUpdateUser());
rdbmsHorScalingValue = valueDao.getById(rdbmsHorScalingValue.getId());
assertEquals(user3, rdbmsHorScalingValue.getUpdateUser()); // Error here !!!!
I have updated rdbmsHorScalingValue
with user3 and after getting Value
by id (valueDao.getById())
I expect this user as rdbmsHorScalingValue.getUpdateUser()
but for some unknown reason, it is not true.
But if we change at the following method: com.decisionwanted.domain.dao.decision.characteristic.value.history.HistoryValueDaoImpl.create(Value)
saving depth from 1
to 2
- everything starts working fine.
Right now I don't know where is the issue and the only thing I know - it is working fine with saving depth = 1 with SDN 4.2.
Please tell me where is the issue(why it doesn't work with SDN 5) and how to solve it.