public int doTransaction(DB db, Object threadstate, int threadid,  StringBuilder updateLog, StringBuilder readLog,  int seqID, HashMap<String, Integer> resUpdateOperations
			, HashMap<String, Integer> friendshipInfo, HashMap<String, Integer> pendingInfo, int thinkTime, boolean insertImage, boolean warmup)
	{
		String op=operationchooser.nextString();
		int opsDone = 0;

		if (op.compareTo("OWNPROFILE")==0)
		{
			opsDone = doTransactionOwnProfile(db, threadid, updateLog, readLog ,seqID, thinkTime, insertImage,  warmup);
		}
		else if (op.compareTo("FRIENDPROFILE")==0)
		{
			opsDone = doTransactionFriendProfile(db, threadid, updateLog, readLog,seqID, thinkTime,  insertImage, warmup);
		}
		else if (op.compareTo("POSTCOMMENT")==0)
		{
			opsDone = doTransactionPostCommentOnResource(db,threadid, updateLog, readLog,seqID, resUpdateOperations, thinkTime, insertImage, warmup);
		}
		else if (op.compareTo("DELCOMMENT")==0)
		{
			opsDone = doTransactionDeleteCommentOnResource(db,threadid, updateLog, readLog,seqID, resUpdateOperations, thinkTime, insertImage, warmup);
		}
		else if (op.compareTo("ACCEPTREQ")==0)
		{
			opsDone = doTransactionAcceptFriendship(db,threadid,  updateLog, readLog,seqID, friendshipInfo, pendingInfo, thinkTime, insertImage, warmup);
		}
		else if (op.compareTo("REJECTREQ") == 0)
		{
			opsDone = doTransactionRejectFriendship(db,threadid,  updateLog,readLog ,seqID, friendshipInfo, pendingInfo, thinkTime, insertImage, warmup);
		}
		else if (op.compareTo("UNFRNDACCEPTREQ") == 0)
		{
			opsDone = doTransactionUnfriendPendingFriendship(db,threadid, updateLog,readLog, seqID, friendshipInfo, pendingInfo, thinkTime, "ACCEPT", insertImage, warmup);
		}
		else if (op.compareTo("UNFRNDREJECTREQ") == 0)
		{
			opsDone = doTransactionUnfriendPendingFriendship(db,threadid, updateLog, readLog,seqID, friendshipInfo, pendingInfo, thinkTime, "REJECT", insertImage, warmup);
		}
		else if (op.compareTo("UNFRNDREQ") == 0)
		{
			opsDone = doTransactionUnfriendFriendship(db,threadid,  updateLog, readLog,seqID, friendshipInfo, pendingInfo, thinkTime, insertImage, warmup);
		}
		else if (op.compareTo("GENFRNDREQ") == 0)
		{
			opsDone = doTransactionGenerateFriendship(db,threadid,  updateLog, readLog ,seqID, friendshipInfo, pendingInfo, thinkTime, insertImage, warmup);
		}
		//actions
		else if (op.compareTo("GETPROACT") == 0)
		{
			opsDone = doActionGetProfile(db, threadid, updateLog, readLog ,seqID, insertImage, warmup);
		}
		else if (op.compareTo("GETFRNDLSTACT") == 0)
		{
			opsDone = doActionGetFriends(db,threadid, updateLog,readLog,seqID, insertImage, warmup);
		}
		else if (op.compareTo("GETPENDACT") == 0)
		{
			opsDone = doActionGetPendings(db,threadid, updateLog,readLog,seqID, insertImage, warmup);
		}
		else if (op.compareTo("INVFRNDACT") == 0)
		{
			opsDone = doActioninviteFriend(db,threadid, updateLog,readLog, seqID, friendshipInfo, pendingInfo, insertImage, warmup);
		}
		else if (op.compareTo("ACCFRNDACT") == 0)
		{
			opsDone = doActionAcceptFriends(db, threadid, updateLog,readLog, seqID, friendshipInfo,pendingInfo, thinkTime,  insertImage,warmup);
		}
		else if (op.compareTo("REJFRNDACT") == 0)
		{
			opsDone = doActionRejectFriends(db, threadid, updateLog,readLog, seqID, friendshipInfo,pendingInfo, thinkTime,  insertImage,warmup);
		}
		else if (op.compareTo("UNFRNDACT") == 0)
		{
			opsDone = doActionUnFriendFriends(db, threadid,updateLog,readLog, seqID, friendshipInfo
					,pendingInfo, thinkTime,  insertImage, warmup);
		}
		else if (op.compareTo("GETRESACT") == 0)
		{
			opsDone = doActionGetTopResources(db, threadid, updateLog, readLog ,seqID, insertImage,  warmup);
		}
		else if (op.compareTo("GETCMTACT") == 0)
		{
			opsDone = doActionviewCommentOnResource(db, threadid, updateLog, readLog ,seqID, thinkTime, insertImage,  warmup);
		}
		else if (op.compareTo("POSTCMTACT") == 0)
		{
			opsDone = doActionPostComments(db,threadid, updateLog, readLog,seqID, resUpdateOperations,thinkTime, insertImage,  warmup);
		}
		else if (op.compareTo("DELCMTACT") == 0)
		{
			opsDone = doActionDelComments(db,threadid, updateLog, readLog,seqID, resUpdateOperations,thinkTime, insertImage,  warmup);
		}

		return opsDone;
	}