Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3594824
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:46:01+00:00 2026-05-18T19:46:01+00:00

I’m making a simple high scores database for an iPhone game using Amazon’s SimpleDB

  • 0

I’m making a simple high scores database for an iPhone game using Amazon’s SimpleDB and am running into some strange issues where SimpleDB’s response messages don’t seem to line up with the requests I’m sending or even the state of the data on the server.

The expected sequence of events for submitting high scores in the app is:

  1. A PutAttributes request is created
    that tries to overwrite the current
    score with the new value but only if
    it is greater than the last known
    value of the score.

  2. If the expected value doesn’t match the value on the server, SimpleDB’s response message lets the app know what the actual value is and a new request is created using it as the new expected value.

  3. This process continues until either
    the response states that everything
    was OK or until the score on
    the server comes back as higher than
    the score we’re trying to submit
    (i.e. if somebody with a higher
    score submitted while this
    back and forth was going on)

(In case it’s relevant I’m using the ASIHTTPRequest class to handle the requests and I’ve explicitly turned off caching by setting each request’s cache policy to ASIIgnoreCachePolicy when I create them.)

However, what’s actually happening is a bit strange…

  1. The first response comes back with the expected result. For example, the app submits a score of 200 and expects the score on the server to be 0 but it’s actually 100. SimpleDB responds that the conditional check failed and lets the app know the actual value on the server (100).

  2. The app sends a request with an updated expected value but SimpleDB responds with an identical response as the first time even though the expected value was changed (e.g. the response says the actual value is 100 and the expected value we passed in was 0 even though we had just changed it to 100).

  3. The app sends a third request with the exact same score/expected values as the second request (e.g. 100 for both) and SimpleDB reports that the condition failed again because the actual value is 200.

So it looks like the second attempt actually worked even though SimpleDB reported a failure and gave an incorrect account of the parameters I had passed in. This odd behavior is also very consistent – every time I try to update a score with an expected value that doesn’t match the one on the server the exact same sequence occurs.

I’ve been scratching my head at this for a while now and I’m flat out of ideas so if anyone with more SimpleDB experience than me could shed some light on this I’d be mighty grateful.

Below is a sample sequence of requests and responses in case that does a better job of describing the situation than my tortured explanation above (these values taken from actual requests and responses but I’ve edited out the non-relevant parts of the requests).

Request 1
(The score on the server is 100 at this point)

Attribute.1.Name=Score
Attribute.1.Replace=true
Attribute.1.Value=200
Expected.1.Name=Score
Expected.1.Value=000
Consistent=true

Response 1
Conditional check failed. Attribute (Score) value is (100) but was expected (000)

Request 2
(The app updates to proper score but based on the response SimpleDB seems to ignore the changes)

Attribute.1.Name=Score
Attribute.1.Replace=true
Attribute.1.Value=200
Expected.1.Name=Score
Expected.1.Value=100
Consistent=true

Response 2
Conditional check failed. Attribute (Score) value is (100) but was expected (000)

Request 3
(This time SimpleDB gets the expected value right but also reports that the score has been updated even though all previous responses indicated otherwise)

Attribute.1.Name=Score
Attribute.1.Replace=true
Attribute.1.Value=200
Expected.1.Name=Score
Expected.1.Value=100
Consistent=true

Response 3
Conditional check failed. Attribute (Score) value is (200) but was expected (100)

Update (10/21/10)
I checked to make sure that the requestIDs that are being returned from the server are all unique and indeed they are.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T19:46:02+00:00Added an answer on May 18, 2026 at 7:46 pm

    Try passing ConsistentRead=true in your requests.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a French site that I want to parse, but am running into
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.