Skip to content

Commit dc24203

Browse files
author
Likitha Shetty
committed
CLOUDSTACK-305. Everytime a SOAP call is made some transactions are rolled back because the transactions are not committed.
1 parent bb50c0d commit dc24203

7 files changed

Lines changed: 18 additions & 13 deletions

File tree

awsapi/src/com/cloud/bridge/persist/dao/CloudStackConfigurationDaoImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ public String getConfigValue(String name) {
5454
}
5555
return configItem.getValue();
5656
}finally {
57-
57+
txn.commit();
58+
txn.close();
5859
}
5960
}
6061

awsapi/src/com/cloud/bridge/persist/dao/CloudStackSvcOfferingDaoImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public CloudStackServiceOfferingVO getSvcOfferingByName( String name ){
5050
return findOneBy(sc);
5151

5252
}finally {
53+
txn.commit();
5354
txn.close();
5455
}
5556

@@ -68,6 +69,7 @@ public CloudStackServiceOfferingVO getSvcOfferingById( String id ){
6869
return findOneBy(sc);
6970

7071
}finally {
72+
txn.commit();
7173
txn.close();
7274
}
7375

awsapi/src/com/cloud/bridge/persist/dao/CloudStackUserDaoImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public String getSecretKeyByAccessKey( String accessKey ) {
5555
}
5656
return cloudSecretKey;
5757
} finally {
58+
txn.commit();
5859
txn.close();
5960
}
6061
}

awsapi/src/com/cloud/bridge/persist/dao/MHostDaoImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ public MHostVO getByHostKey(String hostKey) {
4444
SearchCriteria<MHostVO> sc = NameSearch.create();
4545
sc.setParameters("MHostKey", hostKey);
4646
return findOneBy(sc);
47-
48-
}finally {
49-
txn.close();
50-
}
47+
} finally {
48+
txn.commit();
49+
txn.close();
50+
}
5151
}
5252

5353
@Override

awsapi/src/com/cloud/bridge/persist/dao/OfferingDaoImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ public int getOfferingCount() {
4343
try {
4444
txn.start();
4545
return listAll().size();
46-
}finally {
46+
} finally {
47+
txn.commit();
4748
txn.close();
4849
}
4950

@@ -61,8 +62,8 @@ public String getCloudOffering( String amazonEC2Offering ) {
6162
SearchCriteria<OfferingBundleVO> sc = searchByAmazon.create();
6263
sc.setParameters("AmazonEC2Offering", amazonEC2Offering);
6364
return findOneBy(sc).getCloudstackOffering();
64-
6565
} finally {
66+
txn.commit();
6667
txn.close();
6768
}
6869
}
@@ -79,8 +80,8 @@ public String getAmazonOffering( String cloudStackOffering ) {
7980
SearchCriteria<OfferingBundleVO> sc = searchByAmazon.create();
8081
sc.setParameters("CloudStackOffering", cloudStackOffering);
8182
return findOneBy(sc).getAmazonOffering();
82-
8383
} finally {
84+
txn.commit();
8485
txn.close();
8586
}
8687
}
@@ -109,7 +110,6 @@ public void setOfferMapping( String amazonEC2Offering, String cloudStackOffering
109110
offering = persist(offering);
110111
else
111112
update(offering.getID(), offering);
112-
113113
txn.commit();
114114
} finally {
115115
txn.close();

awsapi/src/com/cloud/bridge/persist/dao/SHostDaoImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public SHostVO getByHost(String host) {
4242
SearchCriteria<SHostVO> sc = HostSearch.create();
4343
sc.setParameters("Host", host);
4444
return findOneBy(sc);
45-
46-
}finally {
45+
} finally {
46+
txn.commit();
4747
txn.close();
4848
}
4949

@@ -62,8 +62,8 @@ public SHostVO getLocalStorageHost(long mhostId, String storageRoot) {
6262
sc.setParameters("MHostID", mhostId);
6363
sc.setParameters("ExportRoot", storageRoot);
6464
return findOneBy(sc);
65-
66-
}finally {
65+
} finally {
66+
txn.commit();
6767
txn.close();
6868
}
6969
}

awsapi/src/com/cloud/bridge/persist/dao/UserCredentialsDaoImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public UserCredentialsVO getByCertUniqueId( String certId ) {
6767
sc.setParameters("CertUniqueId", certId);
6868
return findOneBy(sc);
6969
}finally {
70+
txn.commit();
7071
txn.close();
7172
}
7273

0 commit comments

Comments
 (0)