Bug 461263 - Race condition exists with mozStorageTransaction

While the race was technically "safe", we could have possibly wrongly tried to
commit or rollback.  This changeset makes us operate sanely in all conditions.
r=bent
This commit is contained in:
Shawn Wilsher 2008-10-24 16:50:01 -04:00
Родитель 799d2cf3af
Коммит 18700696dc
1 изменённых файлов: 3 добавлений и 7 удалений

Просмотреть файл

@ -69,13 +69,9 @@ public:
mCommitOnComplete(aCommitOnComplete),
mCompleted(PR_FALSE)
{
if (mConnection) {
PRBool transactionInProgress = PR_FALSE;
mConnection->GetTransactionInProgress(&transactionInProgress);
mHasTransaction = ! transactionInProgress;
if (mHasTransaction)
mConnection->BeginTransactionAs(aType);
}
// We won't try to get a transaction if one is already in progress.
if (mConnection)
mHasTransaction = NS_SUCCEEDED(mConnection->BeginTransactionAs(aType));
}
~mozStorageTransaction()
{