使用 azure app service 离线同步时,是否可以利用客户端上的事务?
在我看来,您几乎一次只能将一条记录插入到 SQLite 存储中,但理想情况下,我希望能够在事务中提交多条记录。
我现在在 Android 上使用 Xamarin,但也将支持 iOS。
谢谢
马特
使用 azure app service 离线同步时,是否可以利用客户端上的事务?
在我看来,您几乎一次只能将一条记录插入到 SQLite 存储中,但理想情况下,我希望能够在事务中提交多条记录。
我现在在 Android 上使用 Xamarin,但也将支持 iOS。
谢谢
马特
Unfortunately, on Windows, Xamarin, and Android you can only commit one record at a time on the local MobileServicesSQLiteStore. This is because changes need to be made one at a time using methods like SyncTable.UpdateAsync, which is how you mark a change as being tracked to send to the server.
On native iOS, the Mobile Services offline sync feature uses Core Data, which does support a form of transaction (https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreData/Articles/cdMemory.html). If you use these APIs, you still need to make calls to the Mobile Services SDK methods to track each individual change in the internal tracking tables.
Why do you need transactions on the client side? There might be a different way to achieve your goal.