Object Manager has been closed error


I recently faced this strange situation when datanculeus started throwing a "Object Manager has been closed" exception.

This basically means I'm trying to detach the object in hand after the persistence manager was closed. But that wasn't the case at all !

However, regarding the way I solved this, here is my assumption.

Even if: 
  • Your field is included in the default fetch group (defaultFetchGroup = "true")
  • You enabled detachment on closing the persistence manager (datanucleus.DetachOnClose=true)
You still have to keep the level 1 cache enabled in order for detachment to occur ! But in my case I had it disabled. Or you'll have to detach a copy of the object yourself after querying it.

Comments

Popular posts from this blog

Testing SOAP services using pingdom