mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-17 11:04:00 +01:00
lockRow doesn't work without transaction, start transaction before lockRow
This commit is contained in:
parent
354d259d55
commit
a8bb62c35c
@ -2614,7 +2614,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
|
|||||||
public boolean shutdownNetwork(long networkId, ReservationContext context, boolean cleanupElements) {
|
public boolean shutdownNetwork(long networkId, ReservationContext context, boolean cleanupElements) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
Transaction txn = Transaction.currentTxn();
|
Transaction txn = Transaction.currentTxn();
|
||||||
|
txn.start();
|
||||||
NetworkVO network = _networksDao.lockRow(networkId, true);
|
NetworkVO network = _networksDao.lockRow(networkId, true);
|
||||||
if (network == null) {
|
if (network == null) {
|
||||||
s_logger.debug("Unable to find network with id: " + networkId);
|
s_logger.debug("Unable to find network with id: " + networkId);
|
||||||
@ -2625,7 +2625,6 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
txn.start();
|
|
||||||
if (isSharedNetworkWithServices(network)) {
|
if (isSharedNetworkWithServices(network)) {
|
||||||
network.setState(Network.State.Shutdown);
|
network.setState(Network.State.Shutdown);
|
||||||
_networksDao.update(network.getId(), network);
|
_networksDao.update(network.getId(), network);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user