If you receive the “The cursor is invalid for instantiating recordViewCache” message then try to move your method in the server side.
For example if you have class that extend RunBaseBatch then create runOnServer() method and move all code from the run() method to the runOnServer() method.
void run() { ; ClassName::runOnServer(); } static server void runOnServer() { //code from the run() method }