Have you looked into Memcache's INCR?

http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/memcache/MemcacheService.html#increment(java.lang.Object,
long)

This'll do it atomically, but you run the risk of it being volatile,
so you'll have to account for that in your client code.

On Tue, Mar 2, 2010 at 11:40 PM, legendlink <gregc...@gmail.com> wrote:
> hi, i wanted to have a sequence generator that increments by x value
> everytime it generates a value. if i would create the sequence
> generator by using the datastore, it is likely that data contention
> would occurr if there is high access times.
>
> i have looked into the sample code of max ross in the google code
> repository (SequenceExamplesJDO.java) and  think this is limited to
> increment by 1 only and not increment by x value.
>
> if sharding technique is used, my concern is that i might not get the
> right sequence.
>
> what is the best/elegant way of doing sequence generator that
> increments x value?
>
> --
> 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 google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>



-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

-- 
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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to