private <T extends VMInstanceVO> void moveVmOutofMigratingStateOnSuccess(final T vm, final Long hostId, final ItWorkVO work) throws ConcurrentOperationException { // Put the vm in running state. try { if (!changeState(vm, Event.OperationSucceeded, hostId, work, Step.Started)) { s_logger.error("Unable to change the state for " + vm); throw new ConcurrentOperationException("Unable to change the state for " + vm); } } catch (final NoTransitionException e) { s_logger.error("Unable to change state due to " + e.getMessage()); throw new ConcurrentOperationException("Unable to change state due to " + e.getMessage()); } }
private <T extends VMInstanceVO> void moveVmToMigratingState(final T vm, final Long hostId, final ItWorkVO work) throws ConcurrentOperationException { // Put the vm in migrating state. try { if (!changeState(vm, Event.MigrationRequested, hostId, work, Step.Migrating)) { s_logger.info("Migration cancelled because state has changed: " + vm); throw new ConcurrentOperationException("Migration cancelled because state has changed: " + vm); } } catch (final NoTransitionException e) { s_logger.info("Migration cancelled because " + e.getMessage()); throw new ConcurrentOperationException("Migration cancelled because " + e.getMessage()); } }
@Override protected void lock() { final Vpc vpcLock = vpcDao.acquireInLockTable(vpc.getId()); if (vpcLock == null) { throw new ConcurrentOperationException("Unable to lock vpc " + vpc.getId()); } tableLockId = vpcLock.getId(); }
} catch (final InterruptedException e) { s_logger.info("Waiting for " + vm + " but is interrupted"); throw new ConcurrentOperationException("Waiting for " + vm + " but is interrupted");
@Override public PublicIp doInTransaction(TransactionStatus status) throws InsufficientAddressCapacityException { Account owner = _accountDao.acquireInLockTable(ownerId); if (owner == null) { // this ownerId comes from owner or type Account. See the class "AccountVO" and the annotations in that class // to get the table name and field name that is queried to fill this ownerid. ConcurrentOperationException ex = new ConcurrentOperationException("Unable to lock account"); throw ex; } if (s_logger.isDebugEnabled()) { s_logger.debug("lock account " + ownerId + " is acquired"); } boolean displayIp = true; if (guestNtwkId != null) { Network ntwk = _networksDao.findById(guestNtwkId); displayIp = ntwk.getDisplayNetwork(); } else if (vpcId != null) { VpcVO vpc = _vpcDao.findById(vpcId); displayIp = vpc.isDisplay(); } return fetchNewPublicIp(dcId, null, null, owner, VlanType.VirtualNetwork, guestNtwkId, isSourceNat, true, null, false, vpcId, displayIp, false); } });
protected void lock() { final Network lock = networkDao.acquireInLockTable(guestNetwork.getId(), NetworkOrchestrationService.NetworkLockTimeout.value()); if (lock == null) { throw new ConcurrentOperationException("Unable to lock network " + guestNetwork.getId()); } tableLockId = lock.getId(); }
throw new ConcurrentOperationException("Unable to acquire lock on " + vm); throw new ConcurrentOperationException("There are concurrent operations on " + vm); } else { continue; throw new ConcurrentOperationException("Unable to change the state of " + vm);
ConcurrentOperationException ex = new ConcurrentOperationException("Unable to lock account"); throw ex;
private boolean lockNetworkForUserVm(Network network, VirtualMachineProfile vm) { if (!vm.getVirtualMachine().getType().isUsedBySystem()) { long networkId = network.getId(); network = _networkDao.acquireInLockTable(network.getId(), 1200); if (network == null) { throw new ConcurrentOperationException("Unable to acquire lock on network " + networkId); } return true; } return false; }
if (accountToLock == null) { s_logger.warn("Unable to lock account: " + ipOwner.getId()); throw new ConcurrentOperationException("Unable to acquire account lock");
throw new ConcurrentOperationException("Unable to lock gateway " + gatewayId);
final Network lock = _networkDao.acquireInLockTable(guestNetwork.getId(), NetworkOrchestrationService.NetworkLockTimeout.value()); if (lock == null) { throw new ConcurrentOperationException("Unable to lock network " + guestNetwork.getId());
network = _networkDao.acquireInLockTable(networkId, 1200); if (network == null) { throw new ConcurrentOperationException("Unable to acquire lock on network " + networkId);
if (network == null) { final ConcurrentOperationException ex = new ConcurrentOperationException("Unable to acquire network configuration"); ex.addProxyObject(_entityMgr.findById(Network.class, networkId).getUuid()); throw ex;
throw new ConcurrentOperationException("Unable to lock nic " + nic.getId());
throw new ConcurrentOperationException("Unable to acquire network lock: " + guestNetworkId);
throw new ConcurrentOperationException("Failed to deploy VM "+vm);
throw new ConcurrentOperationException("Multiple threads are trying to update data object state, racing condition");
network = _networkDao.acquireInLockTable(network.getId(), 1200); if (network == null) { throw new ConcurrentOperationException("Unable to acquire lock on network " + networkId);
final NicVO nic = _nicDao.lockRow(nicId, true); if (nic == null) { throw new ConcurrentOperationException("Unable to acquire lock on nic " + nic);