Skip to content

Commit 8d81ec4

Browse files
hsato03Henrique Sato
andauthored
keep deleted projects name (#7858)
Co-authored-by: Henrique Sato <henrique.sato@scclouds.com.br>
1 parent 7541cb9 commit 8d81ec4

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

engine/schema/src/main/java/com/cloud/projects/dao/ProjectDaoImpl.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import com.cloud.utils.db.SearchBuilder;
3434
import com.cloud.utils.db.SearchCriteria;
3535
import com.cloud.utils.db.SearchCriteria.Func;
36-
import com.cloud.utils.db.TransactionLegacy;
3736

3837
@Component
3938
public class ProjectDaoImpl extends GenericDaoBase<ProjectVO, Long> implements ProjectDao {
@@ -71,22 +70,8 @@ public ProjectVO findByNameAndDomain(String name, long domainId) {
7170
@Override
7271
@DB
7372
public boolean remove(Long projectId) {
74-
boolean result = false;
75-
TransactionLegacy txn = TransactionLegacy.currentTxn();
76-
txn.start();
77-
ProjectVO projectToRemove = findById(projectId);
78-
projectToRemove.setName(null);
79-
if (!update(projectId, projectToRemove)) {
80-
s_logger.warn("Failed to reset name for the project id=" + projectId + " as a part of project remove");
81-
return false;
82-
}
83-
8473
_tagsDao.removeByIdAndType(projectId, ResourceObjectType.Project);
85-
result = super.remove(projectId);
86-
txn.commit();
87-
88-
return result;
89-
74+
return super.remove(projectId);
9075
}
9176

9277
@Override

0 commit comments

Comments
 (0)