I have many tables that I am connecting to in quick succession, but when I grab the object type and do a query, sometimes persistence will return the wrong __type when using the list() function on a websql/sql/sqlite implementation of persistence.Do I have to flush() before qeuring? How can I ensure I am getting the right type back?
Thanks.
Try:
persistence.schemaSync(persistence.flush(function(){
// your code to populate or do whatever
}));
You have to make sure schemaSync and flush are done before proceeding, hence waiting for the flush callback.
As you wish: https://gist.github.com/3656872It appears to be a race condition. If it truly is, what do you suggest the best way to go about avoiding this?