bug 11190: Treating the max account limits with -1 values as infinite. When acquiring a lock to check for resourceLimitExceeded if the lock times out then return as limit exceeded.

This commit is contained in:
Nitin 2011-09-12 14:26:15 +05:30
parent 39d85301e2
commit e786533b27
1 changed files with 3 additions and 2 deletions

View File

@ -377,7 +377,7 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
AccountVO accountVo = _accountDao.findById(account.getAccountId());
long accountLimit = findCorrectResourceLimit(accountVo, type);
long potentialCount = _resourceCountDao.getAccountCount(account.getId(), type) + numResources;
if (potentialCount > accountLimit) {
if (accountLimit != -1 && potentialCount > accountLimit) {
return true;
}
@ -394,12 +394,13 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
DomainVO domain = _domainDao.findById(domainId);
domainId = domain.getParent();
}
return false;
} finally {
m_resourceCountLock.unlock();
}
}
return false;
return true;
}
@Override