EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName);
EOModel model = entity.model();
EODatabaseContext dbc = EODatabaseContext.registeredDatabaseContextForModel(model, ec);
Object aggregateValue = null;
dbc.lock();
try {
aggregateValue = __aggregateFunctionWithQualifierAndAggregateAttribute(dbc, ec, entityName, qualifier, aggregateAttribute);
}
catch (Exception localException) {
if (dbc._isDroppedConnectionException(localException)) {