private WriteResponseList processRecordsInBatchMode(Record[] records, String methodName, int batchSize, Preferences preferences) {
    	ArrayList<WriteResponse> responses = new ArrayList<WriteResponse>();
		
		Record[] batch = new Record[batchSize];
    	for (int i=0; i<records.length; i++) {    		
    		if (i != 0 && (i%batchSize == 0)) {
    			processBatch(batch, responses, methodName, preferences);  			
    			batch = new Record[batchSize];    			
    		}    		
    		batch[i%batchSize] = records[i];
    	}   	
    	
    	int leftOverCount = 0;
    	for (int j=0; j<batch.length; j++)
    		if (batch[j] != null)
    			leftOverCount++;
    	
    	Record[] leftOvers = new Record[leftOverCount];
    	for (int j=0; j<leftOvers.length; j++)
    		leftOvers[j] = batch[j];
    	
    	processBatch(leftOvers, responses, methodName, preferences); 
		
		WriteResponseList wrl = new WriteResponseList();
    	wrl.setWriteResponse(new WriteResponse[records.length]);
    	for (int i=0; i<responses.size();i++)
    		wrl.getWriteResponse()[i] = responses.get(i); 
    	return wrl;
    }