+ Start a Discussion
minciminci 

Mysterious Batch Apex issue.

Hi all,

I am running a vatch apex application.

The query that I use returns (just for now!!!!) 398 Accounts.

I got unexpected results. So, I looked and the debug logs...

WELL It turns out that the execute() method was called just with the first 200 records and thats it!

I havn't noticed a second call with the rest 198 records and the Batch finished its execution.

There is nothing more to wait for. (I write this because I know Bach Apex is asynchronious).

 

Have anyone face such a strange situatiion? How can I make it work well?

Thanks,

 

SargeSarge

Can you post the code so that solving the problem makes easier.

 

cheers..

minciminci

Well... lets see:

the start:

 

allDonglesQuery = m_query;

}

 

 

 

if (m_query != null){else{//EmilK // Sql query brings all dongles in the system 'Select Id, Customer__c, On_Maintenance__c'+', Inventor__c, HSM__c, X5_axis__c'+', SolidWorks__c, SolidCAM_Mill_3D__c'+',Is_Relevant__c, Name'+' from Dongle__c'+' ORDER BY Customer__c';return Database.getQueryLocator(allDonglesQuery);

 

 

allDonglesQuery =

 

 

 

 

 

}

 

 

 

the execute function

 

 

 

List<

 

dongleList.add((

}

DongleUpdateNotifier.update_accounts_on_schedule(dongleList);

 

 

global void execute(Database.BatchableContext BC, List<sObject> scope){

Dongle__c> dongleList = new List<Dongle__c>();

for(sObject anyObj : scope )

{Dongle__c)anyObj);

 

DongleUpdateNotifier.update_accounts_on_schedule(dongleList);

}

}

 

the called function end successfuly.

No exceptions. No error.

Thanks,

minciminci

The copy & pastte was nasty:

In the for loop i am adding dongle__c to the dongles list.