зеркало из https://github.com/mozilla/pjs.git
Bug 462434 - Transaction semantics are bad
This propagates errors in starting and ending transactions. r=asuth
This commit is contained in:
Родитель
0c6223cfa4
Коммит
d407c1afce
|
@ -530,7 +530,7 @@ mozStorageConnection::BeginTransactionAs(PRInt32 aTransactionType)
|
|||
}
|
||||
if (NS_SUCCEEDED(rv))
|
||||
mTransactionInProgress = PR_TRUE;
|
||||
return NS_OK;
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -539,9 +539,9 @@ mozStorageConnection::CommitTransaction()
|
|||
nsAutoLock mutex(mTransactionMutex);
|
||||
if (!mTransactionInProgress)
|
||||
return NS_ERROR_FAILURE;
|
||||
nsresult rv = ExecuteSimpleSQL (NS_LITERAL_CSTRING("COMMIT TRANSACTION"));
|
||||
// even if the commit fails, the transaction is aborted
|
||||
mTransactionInProgress = PR_FALSE;
|
||||
nsresult rv = ExecuteSimpleSQL(NS_LITERAL_CSTRING("COMMIT TRANSACTION"));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
mTransactionInProgress = PR_FALSE;
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -551,8 +551,9 @@ mozStorageConnection::RollbackTransaction()
|
|||
nsAutoLock mutex(mTransactionMutex);
|
||||
if (!mTransactionInProgress)
|
||||
return NS_ERROR_FAILURE;
|
||||
nsresult rv = ExecuteSimpleSQL (NS_LITERAL_CSTRING("ROLLBACK TRANSACTION"));
|
||||
mTransactionInProgress = PR_FALSE;
|
||||
nsresult rv = ExecuteSimpleSQL(NS_LITERAL_CSTRING("ROLLBACK TRANSACTION"));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
mTransactionInProgress = PR_FALSE;
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче