public int doActionDelComments(DB db,int threadid, StringBuilder updateLog, StringBuilder readLog,int seqID, HashMap<String, Integer> resUpdateOperations, int thinkTime, boolean insertImage, boolean warmup)
	{
		// a user can only delete a comment on her own resource
		int numOpsDone = 0;
		int keyname = buildKeyName(usercount);
		keyname = activateUser(keyname);
		if(keyname == -1)
			return 0;
		incrUserRef(keyname);
		Vector<Integer> profilekeynameresources = createdResources[memberIdxs.get(keyname)];
		if(profilekeynameresources.size() > 0){
			Random random = new Random();
			int idx = random.nextInt(profilekeynameresources.size());
			Vector<HashMap<String,ByteIterator>> cResult=new Vector<HashMap<String,ByteIterator>>();
			String resourceID = "";
			resourceID = profilekeynameresources.get(idx).toString();
			if(!warmup){
				try {
					sCmts.acquire();
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				if(postedComments.get(Integer.parseInt(resourceID)) != null && postedComments.get(Integer.parseInt(resourceID)).size()>0 ){
					int midx = random.nextInt(postedComments.get(Integer.parseInt(resourceID)).size());
					int mid = postedComments.get(Integer.parseInt(resourceID)).get(midx);
					postedComments.get(Integer.parseInt(resourceID)).remove(midx);
					sCmts.release();
					long startUpdate = System.nanoTime();
					int ret =db.delCommentOnResource(keyname,Integer.parseInt(resourceID), mid); 
					if(ret < 0){
						System.out.println("There is an exception in delComment.");
						System.exit(0);
					}
					
					long endUpdate = System.nanoTime();
					numOpsDone++;
					int numUpdatesTillNow = 0;

					if(resUpdateOperations.get(resourceID)!= null){
						numUpdatesTillNow = resUpdateOperations.get(resourceID);
					}
					resUpdateOperations.put(resourceID, (numUpdatesTillNow-1));
					if(enableLogging){
						updateLog.append("UPDATE,POSTCOMMENT,"+seqID+","+threadid+","+resourceID+","+startUpdate+","+endUpdate+","+(numUpdatesTillNow-1)+",D"+"\n");
						updatesExist = true;
					}
				}else
					sCmts.release();
			}
		}
		deactivateUser(keyname);
		return numOpsDone;
	}