You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by Christiaan <ch...@hotmail.com> on 2009/04/06 12:23:08 UTC

Re: Embedded object and evict

hi,
I have concrete scenario where nullifying the state of an embedded object
and losing the "connection" with the datastore causes problems. Suppose the
following settings

javax.jdo.option.RetainValues: false
javax.jdo.option.NontransactionalRead: true
javax.jdo.option.Multithreaded: true

This allows me to have 2 threads: 1 thread doing reads at any moment in
time, and 1 thread doing commits at any moment in time. This scenario works
fine for non embedded objects, but causes problems with embedded objects:

- ReadThread: calls getEmbeddedObject() which clones the embedded object.
- WriteThread is doing a commit at the exact time where
embeddedObject.clone() (clone simply copies the attributes).
- Since the commit nullifies the attributes of the embeddedObject
(retainValues is false), the embedded object with null attributes is
returned. 

For non-embedded objects this is not a problem since on access the values
from the datastore are retrieved again. For embedded objects this not the
case (if the sm is nullified). It seems to me that this behaviour has a big
impact on the design of the application. A design decision I personally
would not consider when marking an object as embedded or not.

kind regards,
Christiaan
-- 
View this message in context: http://www.nabble.com/Embedded-object-and-evict-tp22738918p22906042.html
Sent from the JDO - Development mailing list archive at Nabble.com.