Open
Bug 1686873
Opened 5 years ago
Updated 4 years ago
CalStorageCalendar should use transactions where possible
Categories
(Calendar :: Provider: Local Storage, enhancement)
Calendar
Provider: Local Storage
Tracking
(Not tracked)
NEW
People
(Reporter: lasana, Unassigned)
References
Details
In bug 1671051 I realized the modifyItem() of CalStorageCalendar first deletes data before making updates. This can be dangerous if we have abrupt exits, like the user closing the application or crash etc.
We should look into putting these operations in transactions so failure means the no data is changed.
Comment 1•5 years ago
|
||
I think it's just flushItem and setMetaData, everything else is already in a transaction on account of this.
The pattern is something like this:
this.mDB.beginTransaction();
try {
…
this.mDB.commitTransaction();
} catch (ex) {
this.mDB.rollbackTransaction();
throw ex;
}
| Reporter | ||
Updated•5 years ago
|
Assignee: lasana → nobody
You need to log in
before you can comment on or make changes to this bug.
Description
•