I have a huge XML file (more than 20 Mb) and I can't change its format. It represents DB. In fixed periods of time it can change and I must update all changed data on a device.
I am using SyncAdapter to transfer a huge amount of data from XML to SQLite via ContentProvider. I can't use applyBatch(), because I can't keep all the data in the memory, I want to use the following approach:
Start nonExclusiveTransaction
I want to clear all of the tables in DB (Searching for deleted, updated and created records is slow.)
Parse XML using SAX parser and insert rows as soon as they appear
Commit transaction
I can't find a way to begin and commit a transaction outside ContentProvider. Should I look for a different way to save records in ContentProvider from a 20 Mb XML file?