mirror of https://github.com/apache/cloudstack.git
Some more commands with improper transactions
reviewed-by: Marvin
This commit is contained in:
parent
b1a4ebd84d
commit
d87711f20e
|
|
@ -588,10 +588,10 @@ public class MockStorageManagerImpl implements MockStorageManager {
|
||||||
return new GetStorageStatsAnswer(cmd, "Can't find the secondary storage:" + secUrl);
|
return new GetStorageStatsAnswer(cmd, "Can't find the secondary storage:" + secUrl);
|
||||||
}
|
}
|
||||||
Long totalUsed = _mockVolumeDao.findTotalStorageId(secondary.getId());
|
Long totalUsed = _mockVolumeDao.findTotalStorageId(secondary.getId());
|
||||||
|
txn.commit();
|
||||||
return new GetStorageStatsAnswer(cmd, secondary.getCapacity(), totalUsed);
|
return new GetStorageStatsAnswer(cmd, secondary.getCapacity(), totalUsed);
|
||||||
} else {
|
} else {
|
||||||
MockStoragePoolVO pool = _mockStoragePoolDao.findByUuid(uuid);
|
MockStoragePoolVO pool = _mockStoragePoolDao.findByUuid(uuid);
|
||||||
txn.commit();
|
|
||||||
if (pool == null) {
|
if (pool == null) {
|
||||||
return new GetStorageStatsAnswer(cmd, "Can't find the pool");
|
return new GetStorageStatsAnswer(cmd, "Can't find the pool");
|
||||||
}
|
}
|
||||||
|
|
@ -599,6 +599,7 @@ public class MockStorageManagerImpl implements MockStorageManager {
|
||||||
if (totalUsed == null) {
|
if (totalUsed == null) {
|
||||||
totalUsed = 0L;
|
totalUsed = 0L;
|
||||||
}
|
}
|
||||||
|
txn.commit();
|
||||||
return new GetStorageStatsAnswer(cmd, pool.getCapacity(), totalUsed);
|
return new GetStorageStatsAnswer(cmd, pool.getCapacity(), totalUsed);
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ public class SimulatorManagerImpl implements SimulatorManager {
|
||||||
@DB
|
@DB
|
||||||
@Override
|
@Override
|
||||||
public Answer simulate(Command cmd, String hostGuid) {
|
public Answer simulate(Command cmd, String hostGuid) {
|
||||||
Transaction txn = Transaction.currentTxn();
|
Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
|
||||||
txn.transitToUserManagedConnection(_concierge.conn());
|
txn.transitToUserManagedConnection(_concierge.conn());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue