Valued Contributor.
Valued Contributor.

VTS question regarding lrvtc_query_row(int rowIndex)

I will be using  below code for reading (not consuming) data from a VTS table. My question is; whether this will work for around 50 concurrent users or do I need to make any updates on this? In  my scenario, I require to use unique data. My doubt in this code is;whether I will get duplicated data.

	int colSize;
	int iRow;
	// Obtain the count of rows populated for column named "Col1":
	colSize = lrvtc_column_size("Col1");
	lr_message("*** Col1 size = %d",colSize); 

	for( iRow = 1; iRow <= colSize; iRow ++ ) {
		// Retrieve, for the physical row index given, all columns:
		rc = lrvtc_query_row( iRow );
		lr_message("Row %d Col1=%s", iRow, lr_eval_string({Col1}));
Tags (1)
1 Reply
Frequent Contributor.
Frequent Contributor.

Re: VTS question regarding lrvtc_query_row(int rowIndex)


First, each VTC API can be considered as an atom operation to the Virtual Table,  concurrent issues has been carefully considered through the design and implementation of VTS.

Second,  lrvtc_query_row only read a row, it didn’t change the table, as long as the table is not updated, Vusers will get same result when pass same RowIndex to the lrvtc_query_row.

Third, if you what to guarantee each Vuser get a unique row, here are some possible ways:

  • Use lrvtc_retrieve_row, Pops the first fields from all columns. data is consumed.
  • Use lrvtc_rotate_row , Retrieve the first row and rotate it to last. As long as the virtual table is large enough and hasn’t rotated a circle, the data is unique.
  • In controller, make sure VuserID is from 1 to a number not large than the total row number in VTS, then in script use the VuserID parameter as row index to call lrvtc_query_row(). As VuserID is unique, you’ll get an unique row for each Vuser.


Bingle(LoadRunner R&D)

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.