You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by St...@zas.admin.ch on 2004/06/03 16:50:37 UTC

Update strategy




Bonjour à tous !

I am planning to develop an application with OJB.

This application will access quite a lot of objects and update only some of
them. I do not want to track in the model layer if an object was updated or
not, I would rather like to delegate this task to my persistence layer
built upon OJB.

The simplest algorithm I see is to call PersistenceBroker.store() for every
object in the cache but, since most of the objects that are read do not
need to be updated, this way is not practicable because it would lead to
far too much DB access.

I had then the idea to customize the OJB proxy-mechanism to keep track of
the updates to the real objects after their materialization, but I did not
find any documented way to do that.

Third idea : customise the cache to keep a copy of the data that was read
from the DB at the materialisation of an object. With that information it
would be easy to test if the data has been updated by the user or not.
Unfortunately, I don't know how to be informed of the materialisation of
the objects.

Has someone a hint ?

Stefano Juri


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Update strategy

Posted by Brian McCallister <mc...@forthillcompany.com>.
Stefano,

The ODMG and OTM api's provide dirty tracking right now. Updates are 
figured out and executed on transaction commit =)

-Brian

On Jun 3, 2004, at 10:50 AM, Stefano.Juri@zas.admin.ch wrote:

>
>
>
>
> Bonjour à tous !
>
> I am planning to develop an application with OJB.
>
> This application will access quite a lot of objects and update only 
> some of
> them. I do not want to track in the model layer if an object was 
> updated or
> not, I would rather like to delegate this task to my persistence layer
> built upon OJB.
>
> The simplest algorithm I see is to call PersistenceBroker.store() for 
> every
> object in the cache but, since most of the objects that are read do not
> need to be updated, this way is not practicable because it would lead 
> to
> far too much DB access.
>
> I had then the idea to customize the OJB proxy-mechanism to keep track 
> of
> the updates to the real objects after their materialization, but I did 
> not
> find any documented way to do that.
>
> Third idea : customise the cache to keep a copy of the data that was 
> read
> from the DB at the materialisation of an object. With that information 
> it
> would be easy to test if the data has been updated by the user or not.
> Unfortunately, I don't know how to be informed of the materialisation 
> of
> the objects.
>
> Has someone a hint ?
>
> Stefano Juri
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org