Thanks Gray! The solution, as mentioned, is Gray using the callBatchTasks method:
public void updateListOfObjects (final List <Object> list) { try { getHelper().getObjectDao().callBatchTasks(new Callable<Object> (){ @Override public Object call() throws Exception { for (Object obj : list){ getHelper().getObjectDao().createOrUpdate(obj); } return null; } }); } catch (Exception e) { Log.d(TAG, "updateListOfObjects. Exception " + e.toString()); } }
Using this method, my objects (two types of objects, type 1 - about 100 items, type 2 - about 150 items) are stored in 1.7 seconds.
See the ORMLite documentation.
source share