mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-25 06:10:35 +00:00
set mURI only after everything is initialized; also, move commitTransaction() into try blocks. notpartoftehbuild
This commit is contained in:
parent
ebbbdf27da
commit
e42feaf8d7
@ -169,7 +169,6 @@ calStorageCalendar.prototype = {
|
||||
throw Components.results.NS_ERROR_FAILURE;
|
||||
|
||||
// we can only load storage bits from a file
|
||||
this.mURI = aURI;
|
||||
var fileURL = aURI.QueryInterface(Components.interfaces.nsIFileURL);
|
||||
if (!fileURL)
|
||||
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||
@ -180,6 +179,8 @@ calStorageCalendar.prototype = {
|
||||
this.mDBTwo = dbService.openDatabase (fileURL.file);
|
||||
|
||||
this.initDB();
|
||||
|
||||
this.mURI = aURI;
|
||||
},
|
||||
|
||||
// attribute boolean readOnly;
|
||||
@ -785,12 +786,11 @@ calStorageCalendar.prototype = {
|
||||
|
||||
ip.flags = flags;
|
||||
this.mInsertItem.step();
|
||||
this.mDB.commitTransaction();
|
||||
} catch (e) {
|
||||
dump ("EXCEPTION; error is: " + this.mDB.lastErrorString + "\n");
|
||||
dump (e);
|
||||
this.mDB.rollbackTransaction();
|
||||
failed = true;
|
||||
} finally {
|
||||
this.mDB.commitTransaction();
|
||||
}
|
||||
|
||||
this.mItemCache[item.id] = item;
|
||||
@ -808,11 +808,11 @@ calStorageCalendar.prototype = {
|
||||
this.mDeleteAttendees.step();
|
||||
this.mDeleteProperties.step();
|
||||
this.mDeleteItem.step();
|
||||
} catch (e) {
|
||||
this.mDB.rollbackTransaction();
|
||||
failed = true;
|
||||
} finally {
|
||||
this.mDB.commitTransaction();
|
||||
} catch (e) {
|
||||
dump ("EXCEPTION; error is: " + this.mDB.lastErrorString + "\n");
|
||||
dump (e);
|
||||
this.mDB.rollbackTransaction();
|
||||
}
|
||||
|
||||
delete this.mItemCache[aID];
|
||||
|
Loading…
x
Reference in New Issue
Block a user