Storage limit
Hey! I've got a question.. I'm using something like this:
getDatabase().beginTransaction();
try {
for (JsonTranslator model: models) {
model.convertToModel().save();
}
getDatabase().setTransactionSuccessful();
} catch (Exception error) {
handler.handleResultException(error);
} finally {
getDatabase().endTransaction();
}
what if in the middle of transaction user come to limit of storage space and ignores it? I know that Android will try to clear cache to get more space and supposedly it'll continue.. Is there any problem with it? Im not using caching. Is there any possibility that transaction will somehow loose models before setTransactionSuccessful is called and it'll save nothing?
if the transaction fails without succeeding, the DB rolls back to the previous state it was in. SQLite database ops are ACID (https://www.sqlite.org/transactional.html) so you shouldn't have any real issues with it breaking the DB if it runs out of space.