this is the code I've tried, sorry for the wrong entry..
This code doenst work too:

// Empresa class implements Persistable and JSONAble interfaces
pm.setProperty(PersistableManager.BATCH_MODE, Boolean.TRUE);
Empresa emp = new Empresa();

for(int i=0; i<total; i++){
emp.fromJSON(lista.getJSONObject(i));
pm.batchSave(emp);
}
pm.setProperty(PersistableManager.BATCH_MODE, Boolean.FALSE);

// works fine, but when I have to update the Empresa's list from server
// first I delete all, then the error occurs

PersistableManager.getInstance().deleteAll( Empresa.class );