Behaviour of nested UnitOfWork [message #1808442] |
Mon, 24 June 2019 17:09 |
thorsten kruse Messages: 6 Registered: October 2017 |
Junior Member |
|
|
Hi, I noticed some unexpected behaviour, look at this. Read an Employee, create a new Adress, delete all adresses and the Employee:
UnitOfWork uow = getSomeNewUnitOfWork();
Employee bob = ReadEmp("Bob") and create a new Adress for Bob.
UnitOfWork uowN = uow.acquireUnitOfWork();
Employee bobN = uowN.registerObject(bob);
printAllAdresses(bobN); //result is as expected, the new Adress is present
bobN.deleteAllAdresses(use ouwN);
printAllAdresses(bobN); // no adress listed
bobN.delete(use uowN);
uowN.commit();
printAllAdresses(bob); // no adress listed
ouw.commit;
Bob and the old adresses are deleted, but the new adress is inserted to DB. To my mind, this is a bug. What do you think?
Regards
----------------------
Debugging with stop after uowN.commit(); you can see instance bob has still the new adress. If Bob (bobN) is not deleted everything works fine.
UnitOfWorkImpl.commitNestedUnitOfWork calling mergeChangesIntoParent() does not work correctly. I will open a bug.
[Updated on: Tue, 25 June 2019 10:23] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03166 seconds