public int doActioninviteFriend(DB db, int threadid, StringBuilder updateLog, StringBuilder readLog, int seqID, HashMap<String, Integer> friendshipInfo
			,HashMap<String, Integer> pendingInfo, boolean insertImage, boolean warmup)
	{
		int numOpsDone = 0;
		int keyname = buildKeyName(usercount);
		keyname = activateUser(keyname);
		if(keyname == -1)
			return 0;
		incrUserRef(keyname);
		int noRelId = -1;
		noRelId = viewNotRelatedUsers(keyname);
		if(noRelId!= -1 && isActive(noRelId) == -1){ //not two people should invite each other at the same time
			deactivateUser(keyname);
			return numOpsDone;
		}
		if(!warmup){
			if(noRelId == -1){
				//do nothing
			}else{
				long startUpdatei = System.nanoTime();
				int ret = db.inviteFriend(keyname, noRelId);
				if(ret < 0){
					System.out.println("There is an exception in inviteFriend.");
					System.exit(0);
				}
				pendingFrnds[memberIdxs.get(noRelId)].add(keyname);
				int numPendingsForOtherUserTillNow = 0;
				if(pendingInfo.get(Integer.toString(noRelId))!= null){
					numPendingsForOtherUserTillNow = pendingInfo.get(Integer.toString(noRelId));
				}
				pendingInfo.put(Integer.toString(noRelId), (numPendingsForOtherUserTillNow+1));
				long endUpdatei = System.nanoTime();
				numOpsDone++;
				if(enableLogging){
					updateLog.append("UPDATE,PENDFRND,"+seqID+","+threadid+","+noRelId+","+startUpdatei+","+endUpdatei+","+(numPendingsForOtherUserTillNow+1)+",I"+"\n");
					updatesExist= true;
				}
				relateUsers(keyname, noRelId );
				deactivateUser(noRelId);
			}	
		}
		deactivateUser(keyname);
		return numOpsDone;
	}