Thanks Ikai, but I'm not using JDO or JPA.

Instead I'm trying to enhance the objectify (http://code.google.com/p/
objectify-appengine/) library to provide similar functionality.

To reduce the amount of data stored per entity, I was hoping to use
the last committed timestamp instead of an additional version field.

When using the JDO/JPA @Version annotation, does each root entity
store two versions (the last committed timestamp & a custom version
field), or just one version (by reusing the last committed timestamp)?

Brendan

On May 18, 5:13 am, "Ikai L (Google)" <[email protected]> wrote:
> This isn't available in the low level API. Transactions are already using
> the implementation you've described via optimistic locking.
>
> There's an article written by Max Ross about using the @Version annotation
> to achieve the same thing. Check it out:
>
> http://gae-java-persistence.blogspot.com/2009/10/optimistic-locking-w...
>
>
>
>
>
> On Thu, May 13, 2010 at 11:54 PM, brendan <[email protected]> wrote:
> > Slide 54 of Under the Covers of the Google App Engine Datastore by
> > Ryan Barrett states that the "last committed timestamp co-located with
> > root entity".  Is it possible to access this last committed timestamp
> > using the low level datastore API?
>
> > I'd like to be able to access it to create an enhancement to objectify
> > that provides optimistic locking.
>
> > My idea is:
> > - On get(), populate a field in the entity just read with the
> > timestamp.  Probably the field would have an @Lock annotation.
> > - Send entity to gwt client over rpc.
> > - Receive entity back from gwt client over rpc.
> > - On put(), before update check the timestamp and fail if their is a
> > difference.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> > [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<google-appengine-java%2B 
> > [email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
> Ikai Lan
> Developer Relations, Google App Engine
> Twitter:http://twitter.com/ikai
> Delicious:http://delicious.com/ikailan
>
> ----------------
> Google App Engine links:
> Blog:http://googleappengine.blogspot.com
> Twitter:http://twitter.com/app_engine
> Reddit:http://www.reddit.com/r/appengine
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine for Java" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/google-appengine-java?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to