boolean useOptimisticLock = query.isUsingOptimisticLocking();
boolean runningAsBatch = !useOptimisticLock && adapter.supportsBatchUpdates();
BatchAction action = new BatchAction(query, getAdapter(), getEntityResolver());
action.setBatch(runningAsBatch);
action.performAction(connection, observer);
}
/**
* Executes batch query using JDBC Statement batching features.
*