sc.setParameters("podId", podId);
Date now = new Date();
TransactionLegacy txn = TransactionLegacy.currentTxn();
try {
txn.start();
PodVlanVO vo = lockOneRandomRow(sc, true);
if (vo == null) {
return null;
}
vo.setTakenAt(now);
vo.setAccountId(accountId);
update(vo.getId(), vo);
txn.commit();
return vo;
} catch (Exception e) {
throw new CloudRuntimeException("Caught Exception ", e);