// It only makes sense to check for optimistic locking exceptions for objects that actually have a revision
if (persistentObjects.get(0) instanceof HasRevision) {
int nrOfRowsDeleted = sqlSession.delete(bulkDeleteStatement, persistentObjects);
if (nrOfRowsDeleted < persistentObjects.size()) {
throw new ActivitiOptimisticLockingException("One of the entities " + persistentObjectClass
+ " was updated by another transaction concurrently while trying to do a bulk delete");
}
} else {
sqlSession.delete(bulkDeleteStatement, persistentObjects);
}