| Thinking about it, I think I can understand the issue now: HHH-13147 Closed enabled "early insert" behaviour for entities that have a 2nd-level cache enabled. So now if you have some entities with 2nd-level cache and others without, then some will have early insert behavior and others will have delayed insert behavior. This causes the issue above when an "early insert" entity references a "delayed insert" entity: the referenced entity will still be "transient" (not present in the database) when the first entity is being inserted. --> It seems that within one application all entities must use the same strategy? |