Auto Increment ID Roll back in DBFlow
actionbar opened this issue · 2 comments
What does the generated _Table
modeladapter look like and the model?
very sorry! I couldn't reply to you in time due to work reasons.
Following is the model class in my code and _Table modeladapter
Test code
List transactionTests = new ArrayList<>();
transactionTests.add(new TransactionTest("Testing"));
DatabaseDefinition database = FlowManager.getDatabase(AppDatabase.class);
database.beginTransactionAsync(databaseWrapper -> {
for (TransactionTest transactionTest : transactionTests) {
transactionTest.save(databaseWrapper);
Log.e(getLocalClassName(), "Add Success:" + transactionTest.getId());
}
// simulated transaction failure
int ex = 5 / 0;
}).error((transaction, error) -> {
for (TransactionTest transactionTest : transactionTests) {
Log.e(getLocalClassName(), "Add Failure:" + transactionTest.getId());
}
}).build().executeSync();
}
Model
TransactionTest.txt
_Table
TransactionTest_Table.txt