XML을 구문 분석하고 다음 코드를 할거야 DB에 삽입 : 롤백 :) 덕분에 아주 쉽게 큰
db.beginTransaction();
try {
// here you parse and insert onto the DB.
// if any exception is reached (the XML reader connection was dropped or whatever)
// it will catch the exception and end the transaction without making it successful
// and SQLite will rollback all the actions you've done here.
db.setTransactionSuccessful();
} catch(Exception e){
Log.e("MyTag", "Transaction fail. " +
e.getClass().getSimpleName() + " - " +
e.getMessage());
}finally {
db.endTransaction();
}
와우! – bluerob