Skip to content

Commit 482f92a

Browse files
Move the place of sync lock
1 parent 63e4ebf commit 482f92a

File tree

1 file changed

+4
-2
lines changed
  • components/apimgt/org.wso2.carbon.apimgt.governance.impl/src/main/java/org/wso2/carbon/apimgt/governance/impl/dao/impl

1 file changed

+4
-2
lines changed

components/apimgt/org.wso2.carbon.apimgt.governance.impl/src/main/java/org/wso2/carbon/apimgt/governance/impl/dao/impl/ComplianceMgtDAOImpl.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,9 @@ private List<String> getPolicyIdsForRequest(Connection connection, String reques
507507
public void addComplianceEvalResults(String artifactRefId, ArtifactType artifactType, String policyId,
508508
Map<String, List<RuleViolation>> rulesetViolationsMap, String organization)
509509
throws APIMGovernanceException {
510+
511+
resultWrtiteDelLock.lock();
510512
try (Connection connection = APIMGovernanceDBUtil.getConnection()) {
511-
resultWrtiteDelLock.lock();
512513
String artifactKey = getArtifactKey(connection, artifactRefId, artifactType, organization);
513514
if (artifactKey == null) {
514515
throw new APIMGovernanceException(APIMGovExceptionCodes.ARTIFACT_NOT_FOUND, artifactRefId);
@@ -1091,8 +1092,9 @@ public List<String> getPendingPoliciesForArtifact(String artifactRefId,
10911092
@Override
10921093
public void deleteArtifact(String artifactRefId, ArtifactType artifactType, String organization)
10931094
throws APIMGovernanceException {
1095+
1096+
resultWrtiteDelLock.lock();
10941097
try (Connection connection = APIMGovernanceDBUtil.getConnection()) {
1095-
resultWrtiteDelLock.lock();
10961098
connection.setAutoCommit(false);
10971099

10981100
try {

0 commit comments

Comments
 (0)