These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]

Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: performance issue
PostPosted: Thu Apr 28, 2016 8:16 am 

Joined: Thu Apr 28, 2016 8:08 am
Posts: 1
Hi All,

i am working on rest web service. i did one web service deleting some records but it took much time how to reduce deleting time please guide me

@ApiOperation(value = "GenericResponse", notes = "This service deletes a list of existing dataset from a project")
public GenericResponse deleteMultipleDatasetsFromAProject(
@ApiParam(defaultValue = "ndxis") @HeaderParam("SM_USER") String user,
@PathParam("projectId") String projectId,
DeleteDatasetsDTO deleteDatasetsDTO) throws Exception {

GenericResponse genericResponse = new GenericResponse();

long projectID = Long.parseLong(projectId);
Long[] datasetIDs = deleteDatasetsDTO.getDatasetIds();
boolean validateDatasetstoProject = false;
for (long n : datasetIDs) {
validateDatasetstoProject = projectManagmentDelegate
.validateProjectDatasetbyId(projectID, n);
if (!(validateDatasetstoProject))
throw new OtherValidationException(Constants.INVALID_DATASET_ID);

boolean result = false;

result = projectManagmentDelegate.deleteDatasetsFromAProject(
datasetIDs, projectID);

if (result) {
} else {

return genericResponse;

public boolean deleteDatasetsFromAProject(Long[] datasetList, long projectId)
throws IntegrationStudioRepositoryException {
boolean result = false;
if (dataSetRepository.removeMultiple(datasetList))
result = updateProjectTimestampToCurrent(projectId);
return result;

public boolean updateProjectTimestampToCurrent(long projectId)
throws IntegrationStudioRepositoryException {

return projectRepository.updateTimestamp(projectId);

public Boolean removeMultiple(Long[] datasetList)
throws IntegrationStudioRepositoryException {
Boolean status = false;
Session session = sessionFactory.getCurrentSession();

for (long n : datasetList) {

InputDatasetModel anObject = (InputDatasetModel) session.load(
InputDatasetModel.class, n);

if (anObject != null) {
status = true;

return status;

Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.