bug 7123: populate private/linkLocal ip addresses when addPod - added stmt.executeBatch() call to addIpRange methods.

status 7123: resolved fixed
This commit is contained in:
alena 2010-11-08 17:10:25 -08:00
parent 3c1fd1a599
commit 6946f5ace1
2 changed files with 4 additions and 1 deletions

View File

@ -55,6 +55,7 @@ public class DataCenterIpAddressDaoImpl extends GenericDaoBase<DataCenterIpAddre
txn.start();
DataCenterIpAddressVO vo = lockOneRandomRow(sc, true);
if (vo == null) {
txn.rollback();
return null;
}
vo.setTakenAt(new Date());
@ -102,10 +103,11 @@ public class DataCenterIpAddressDaoImpl extends GenericDaoBase<DataCenterIpAddre
stmt.setLong(3, podId);
stmt.addBatch();
}
stmt.executeBatch();
txn.commit();
} catch (SQLException ex) {
throw new CloudRuntimeException("Unable to persist ip address range ", ex);
}
}
}
public void releaseIpAddress(String ipAddress, long dcId, Long instanceId) {

View File

@ -94,6 +94,7 @@ public class DataCenterLinkLocalIpAddressDaoImpl extends GenericDaoBase<DataCent
stmt.setLong(3, podId);
stmt.addBatch();
}
stmt.executeBatch();
txn.commit();
} catch (SQLException e) {
throw new CloudRuntimeException("Unable to insert", e);