[google-appengine] Re: Inconsistency between dev_server and production server on sharded counter behaviour.

2009-02-08 Thread djidjadji

If you have different behavior on dev_appserver and the production
server you should file a bug report in the issue list

http://code.google.com/p/googleappengine/issues/list

At least dev_appserver should report the transaction problem the same
as production.
dev_appserver has code to check for multiple entity groups but it
might miss your situation.
(if you find the bug yourself, don't mention the solution in the issue
report, it won't be part of dev_appserver unless you sign an
agreement, then we have to patch dev_appserver ourself each time there
is a new version)

2009/2/7 Qian Qiao :
> The code in my original email worked in dev_appserver, which I suppose
> is incorrect.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Inconsistency between dev_server and production server on sharded counter behaviour.

2009-02-07 Thread Qian Qiao

On Sat, Feb 7, 2009 at 16:25, djidjadji  wrote:
>
> Every GeneralCounterShard is an entity group.
> A transaction can only operate on ONE entity group.
> Your transaction code accesses every GeneralCounterShard for a given name.
> With sharded counters you NEVER have a perfect value for the total count.
> The value for get_count() <= Sum(shards)
> You use shards because you have object-lock possibilities.
>
> Maybe this will work (using the function names from the article [1])
> Be aware that at maintenance moments memcache is not working.
>
> def get_count_and_increment(name):
>count = get_count(name)
>increment(name)
>return count+1
>
> [1] http://code.google.com/appengine/articles/sharding_counters.html

The code in my original email worked in dev_appserver, which I suppose
is incorrect.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Inconsistency between dev_server and production server on sharded counter behaviour.

2009-02-07 Thread djidjadji

Every GeneralCounterShard is an entity group.
A transaction can only operate on ONE entity group.
Your transaction code accesses every GeneralCounterShard for a given name.
With sharded counters you NEVER have a perfect value for the total count.
The value for get_count() <= Sum(shards)
You use shards because you have object-lock possibilities.

Maybe this will work (using the function names from the article [1])
Be aware that at maintenance moments memcache is not working.

def get_count_and_increment(name):
count = get_count(name)
increment(name)
return count+1

[1] http://code.google.com/appengine/articles/sharding_counters.html

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---