|cascade-remove bug with UOW [message #1069862]
||Tue, 16 July 2013 19:03
| Roger Spall
Registered: January 2013
I know this a 'strange scenario' but due to an ongoing migration, I am using Eclipselink JPA (V2.5) but obtaining a UnitOfWork from the EntityManager using the implementation classes. I then delete an object using the uow:|
The Object model is mapped using JPA XML mapping files, and I know the correct implementation is:
And I am 'lowly migrating a large code base to follow this design.
However, the two approaches give very different results! The XML mapping files state <cascade-all> and / or <cascade-remove> for all relationships. However, when using the uow to delete an object the removes are not cascaded, but when using the entityManager they are - orphan deletion still functions the same in both scenarios.
I don't know if this is a bug, because I don't know if the uow approach is actually supported. My goal is to convert all of the code base to use entityManagers, and the difference in behavior is actually working in my favour - because the existing (Native Eclipse legacy code) code behaves exactly the same as it did before regardless of whether <cascade-remove> is set or not, and we only need to consider remove semantics as the querying / manager bean code for each POJO is converted to proper JPA syntax
Powered by FUDForum
. Page generated in 0.01540 seconds