Ohhh... it is one step beyond that. BaseDataService is in the Sample and not in the Test only.
So, when deployed as a servlet, the servlet's UoW will sit on top of the underlying one. This makes the whole system kind of invalid... As the subsequent requests are accessing Entities directly, outside the UnitOfWork+thread creating them.
Effectively a design flaw.
And now when I try to unwind this, not using 'static' and others, there seems to be circular reference in BuildDeliverySnapshotTest where Cargo needs Delivery and Delivery building needs the Cargo. Probably re-using values from previous tests.
ANyway, I have re-structured this A LOT, but so far on for Cargo A, not for the second variant.
Not sure if I can re-use all the tests without modifications....
-- Niclas