From ee9f97f92ef7d395f6a15f92225c9964e86a15e8 Mon Sep 17 00:00:00 2001 From: Likitha Shetty Date: Fri, 8 Mar 2013 13:59:02 +0530 Subject: [PATCH] CLOUDSTACK-1509. During CreateVLANIPRange while trying to assign Public IPs to a new network if the network offering is persistent we get an NPE. Since associateIpRangeToAccount starts and commits a seaparte transaction, commit the transaction started for createVlanAndPublicIpRange before calling associateIpAddressListToAccount. --- .../src/com/cloud/configuration/ConfigurationManagerImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 62f4fd5d8dd..7f449dec60e 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -2330,10 +2330,10 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati Vlan vlan = createVlanAndPublicIpRange(zoneId, networkId, physicalNetworkId, forVirtualNetwork, podId, startIP, endIP, vlanGateway, vlanNetmask, vlanId, vlanOwner, startIPv6, endIPv6, ip6Gateway, ip6Cidr); + txn.commit(); if (associateIpRangeToAccount) { _networkMgr.associateIpAddressListToAccount(userId, vlanOwner.getId(), zoneId, vlan.getId(), null); } - txn.commit(); // Associate ips to the network if (associateIpRangeToAccount) {