1 Reply Latest reply on Dec 21, 2009 1:58 AM by Gaurav P(Adobe)

    Data/Services:  update DB call not executing?

    pajr

      I am experiencing some behavior with the Data/Services functionality that I don't quite understand.

       

      I have generated a data service through the wizard in Fb.  Everything works great - I can read/update etc.

       

      I have a scenario where an update to the database is triggered, but there is no change to the data.  In other words I'm "updating" the data with identical data (meaning, no records would actually change).

       

      When this "update" is run - the PHP function (that has the update SQL) is never called.  Does the data/services functionality in Fb internally check to see if the update is needed before making the call?  It seems like it does.

       

      If so, how can I catch that?

       

      Imagine this scenario:

       

      user clicks 'save' (thereby updating data) but the user has made no changes:

       

      super-simplified-made-up-pseudo-code:

       

           function runSave(){

                feedbackLabel.text = "saving..."

       

                databaseCaller.addEventLister(doneSave);

                databaseCaller.execute();

           }

       

       

           function doneSave(){

                feedbackLabel.text="saved."

           }

       

       

      That's basically what I'm doing.  If I do runSave() when there is actual data to update, everything is great.

       

      If I do runSave() when there's no actual change to the data, my feedbackLabel becomes "saving..." but doneSave() is never run.  (similarly, if I add a error function, it is never run - so there's no error).

       

      I would expect the update to run regardless of what I passed (assuming it was valid)

       

      So, does Fb check if the update is needed?

       

      How can I catch this scenario (without, of course, manually checking if the update is needed)?

       

      Reasonable chance I'm misunderstanding something here, but this doesn't quite make sense to me.

       

      Thanks!