I have recently noticed something weird while updating a few objects. I have the exact same path of code that runs for either objects. However, for a few objects I have observed that consistently their parent-child is not updated. That is, the child of the relationship is not updated during a persist. I am using JPA/Hibernate with proper cascade, and I call persist on the entity manager.
For some others the parent-child relationship is updated properly. And I am running the *EXACT* same code and going thru the *EXACT* same code path for either objects.
I noticed in the logs, that for the object whose child is not updated, the ID is not updated, example:
com.softlagos.domain.address.PhoneNumber@404c0224[ id=-1 < --- object ID is not updated version=<null> type=BUSINESS phoneNumber=21-2222-4444
However, for the objects whose child is updated, the child object id is updated:
[com.softlagos.domain.address.PhoneNumber@5ed1330[ id=2294 < --- object ID is updated version=8 type=MOBILE phoneNumber=222222
I have already enabled all logs, and I cannot determine the origin of the problem.
I am running MySQL on Linux, and latest hibernate libraries: 3.6.9.Final
Any clues?
Rubens.
_________________ --
Rubens Gomes
www.rubens-gomes.com
|