connection -> {
try {
CopyManager copyManager = new CopyManager((BaseConnection) connectionAccessor
.getRawConnection(connection));
long t1 = System.currentTimeMillis();
copyManager.copyIn("copy " + getEntityName(entityList) + "(" + fieldNames + ") from stdin",
reader);
long elapsedTime = System.currentTimeMillis() - t1;
logger.debug("Wrote {} inserts in {} seconds", entityList.size(),
Math.round(elapsedTime / 10.0) / 100.0);
} catch (Exception e) {