mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 6782: fix NPEs associated with looking up the account after it's been deleted. When cleaning up the account, we delete the accountVO first, then stop/destroy VMs, routers, etc. During this cleanup, there are times when the account needs to be retrieved, and since it's been removed it has to be found by id 'including removed' in order to find it.
status 6782: resolved fixed
This commit is contained in:
parent
50c175d6c1
commit
b4ef066846
@ -174,7 +174,7 @@ public class AccountDaoImpl extends GenericDaoBase<AccountVO, Long> implements A
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void markForCleanup(long accountId) {
|
public void markForCleanup(long accountId) {
|
||||||
AccountVO account = findById(accountId);
|
AccountVO account = findByIdIncludingRemoved(accountId);
|
||||||
if (!account.getNeedsCleanup()) {
|
if (!account.getNeedsCleanup()) {
|
||||||
account.setNeedsCleanup(true);
|
account.setNeedsCleanup(true);
|
||||||
update(accountId, account);
|
update(accountId, account);
|
||||||
|
|||||||
@ -1137,7 +1137,7 @@ public abstract class GenericDaoBase<T, ID extends Serializable> implements Gene
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return _idField != null ? findById(id) : null;
|
return _idField != null ? findByIdIncludingRemoved(id) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@DB(txn=false)
|
@DB(txn=false)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user