Let’s say that within a transaction:
- I retrieve an entity a1 of class A from the database.
- The object a1 is managed, and has a reference to an object b1 of class B that is a proxy
- I can do a1.getB() and that returns a proxy, I can even do a1.getB().getC() and get another proxy
All that fine.
Now, if I get b1 from the database using the primary key, I get an unproxied instance. However, all references from the persistence context still point to the b1 proxy instance. So now, I have 2 managed versions of b1, one being a proxy and another not.
Is this expected?
Thank you in advance!