When bytecode enhancement (enableDirtyTracking) is activated, a flush triggers a load on every proxy instance. The problems seems to be that the proxy is "around" the ManagedEntity implementation (which is this case is the not-loaded entity). Therefore the proxy is accessed to check the entity state. This access causes the load. Find attached a sample application. You can trigger the problem by running "mvn clean test". When enableDirtyTracking is deactivated, the problem does not occur and the "Child"-entity is not loaded (see also SQL statements).
|