memoryCacheRowCount );
memoryCacheRowCount, this.session );
	private void populateData( IRowResultSet rowResultSet, IResultClass rsMeta,			SortSpec sortSpec ) throws DataException	{		long startTime = System.currentTimeMillis( );		// compute the number of rows which can be cached in memory		int memoryCacheRowCount = computeCacheRowCount( rsMeta );		logger.info( "memoryCacheRowCount is " + memoryCacheRowCount );		IResultObject odaObject;		IResultObject[] resultObjects;		List resultObjectsList = new ArrayList( );		int dataCount = 0;		while ( ( odaObject = rowResultSet.next( ) ) != null )		{			dataCount++;			// notice. it is less than or equal			if ( dataCount <= memoryCacheRowCount )			{				//the followed variable is for performance				int odaObjectFieldCount = odaObject.getResultClass( ).getFieldCount( );				int metaFieldCount = rsMeta.getFieldCount( );				if(odaObjectFieldCount < metaFieldCount)				{					//Populate Data according to the given meta data.					Object[] obs = new Object[metaFieldCount];					for ( int i = 1; i <= odaObjectFieldCount; i++ )					{						obs[i - 1] = odaObject.getFieldValue( i );					}					resultObjectsList.add( new ResultObject( rsMeta, obs ) );				}				else				{					resultObjectsList.add( odaObject );				}			}			else			{				logger.info( "DisckCache is used" );				resultObjects = (IResultObject[]) resultObjectsList.toArray( new IResultObject[0] );				// the order is: resultObjects, odaObject, rowResultSet				resultSetCache = new DiskCache( resultObjects,						odaObject,						rowResultSet,						rsMeta,						CacheUtil.getComparator( sortSpec, eventHandler ),						memoryCacheRowCount );				break;			}		}		if ( resultSetCache == null )		{			logger.info( "MemoryCache is used" );			resultObjects = (IResultObject[]) resultObjectsList.toArray( new IResultObject[0] );			resultSetCache = new MemoryCache( resultObjects,					rsMeta,					CacheUtil.getComparator( sortSpec, eventHandler ) );		}		odaObject = null;		resultObjects = null;		resultObjectsList = null;		rowResultSet = null;		long consumedTime = ( System.currentTimeMillis( ) - startTime ) / 1000;		logger.info( "Time consumed by cache is: " + consumedTime + " second" );	}