this is the fastest storage approach, next thing to try -- compare
existing records with the new-to-be and avoid the db update alltogether
if they are the same
trAccDao.getByOrderNoSync(trAcc.getTransactionId(), trAcc.getOrderNo());
if (existingAcc != null) {
existingAcc.copyDataFrom(trAcc);
trAccDao.getByOrderNoSync(trAcc.getTransactionId(), trAcc.getOrderNo());
if (existingAcc != null) {
existingAcc.copyDataFrom(trAcc);
- trAccDao.updateSync(trAcc);
- trAcc = existingAcc;
+ trAccDao.updateSync(existingAcc);
}
else
trAcc.setId(trAccDao.insertSync(trAcc));
}
else
trAcc.setId(trAccDao.insertSync(trAcc));