So, I was able to tackle on aspect of the problem I was dealing with before, but I really want to make it right, if possible.
We're running into problems because we're making several SQLite queries to populate offline data from the local db. We need to know when they are *all* complete before moving on. As many know, querying a local db from the browser is an asynchronous call. When jQuery 1.5 came out, I thought formally incorporating the "promise" architecture into the framework was the answer to my prayers. While I was able to make it work to some degree, combining the "deferreds" has gotten problematic.
Lots of discussion about using deferred with ajax and/or animation. But the DB screams out for this at least as loudly as the ajax calls. I'm making say, 7 different queries that all need to be done before the user can start entering data. Right now, we've put in a 10-second, hard-coded delay to give the browser enough time to complete all it can. Honestly, I'm quite embarassed to admit that but I wasn't getting any traction and we needed to make progress.
I still think deferred is the way to accomplish this. Probably some basic misinterpretation of the examples and/or documentation on my part is leading to this frustration. Is anyone else out there using deferred this way? My original post was here (
http://forum.jquery.com/topic/deferred-sqlite-execution).
Any thoughts and/or discussion is welcome. I really want to solve this in a elegant, reliable way. The hard-coded delay leaves much to be desired!
Scott.