On Wed, Jul 8, 2009 at 2:43 AM, coloradoflyer <[email protected]>wrote:
I have struggled with this problem recently myself. I'm not a JPA expert. It may be that the problem lies in this line: > > when I run the following code: > ... the object is disconnected and retrieved from probably another entity > manager. > Range r = .... > I found that if I instantiated an existing entity myself (like from a direct ResultSet traversal) or I cloned and existing entity I would get this problem. The manual states that in this case (I think it was referring to deserialization) it can't tell the difference between a null value an an "unloaded" field. If you are in fact using an entity manager to get the original instance and you don't leave the VM it should have a proper detached state. Can you post a simple unit test that shows how you are doing things? -- Daryl Stultz _____________________________________ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:[email protected]
