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:
Kris McQueen 2010-10-27 18:23:18 -07:00
parent 50c175d6c1
commit b4ef066846
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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)