我在IOS设备上进行数据库事务时遇到问题.如果用户没有触摸手机,一切都按预期工作.如果用户点击/滚动/触摸屏幕,一些事务直接调用其successCallback,而不调用实际的事务回调.
这里的简化示例:http://jsfiddle.net/Tk9rv/
要测试,只需在IOS上的移动Safari中打开http://jsfiddle.net/Tk9rv/embedded/result/,并且在加载时不要触摸设备.您将看到生成的调试消息列表,如下所示:
database is running
table will be cleared
store method called for '10'.
about to insert '10'.
transaction successful for '10'
store method called for '9'.
about to insert '9'.
transaction successful for '9'
store method called for '8'.
about to insert '8'.
transaction successful for '8'
[...]
Run Code Online (Sandbox Code Playgroud)
现在,重新加载页面并在加载时,滚动并随机点击.您将看到一些"即将插入..."消息丢失.
database is running
table will be cleared
store method called for '10'.
about to insert '10'.
transaction successful for '10'
store method called for …Run Code Online (Sandbox Code Playgroud)