return new ConcurrencyFailureException(buildMessage(task, sql, ex), ex);
return new ConcurrencyFailureException(buildMessage(task, sql, ex), ex);
private void fillResultListWithFutureResults(List<Future<Object>> futures, List<Object> resultList) { for (Future<Object> future : futures) { try { resultList.add(future.get()); } catch (InterruptedException e) { throw new ConcurrencyFailureException( "interrupted when processing data access request in concurrency", e); } catch (ExecutionException e) { throw new ConcurrencyFailureException("something goes wrong in processing", e); } } }
@Override public void updateAclChangeSet(Long aclChangeSetEntityId, long commitTimeMs) { int updated = updateChangeSetEntity(aclChangeSetEntityId, commitTimeMs); if (updated != 1) { throw new ConcurrencyFailureException("Update by ID should delete exactly 1: " + aclChangeSetEntityId); } }
@Override protected ReadableByteChannel getDirectReadableChannel() throws ContentIOException { // ALF-17708: If we got the contentdata from the transactional cache, there's a chance that eager cleaning can // remove the content from under our feet throw new ConcurrencyFailureException(getContentUrl() + " no longer exists"); }
@Override protected ReadableByteChannel getDirectReadableChannel() throws ContentIOException { // ALF-17708: If we got the contentdata from the transactional cache, there's a chance that eager cleaning can // remove the content from under our feet throw new ConcurrencyFailureException(getContentUrl() + " no longer exists"); }
@Override public void updateAclChangeSet(Long aclChangeSetEntityId, long commitTimeMs) { int updated = updateChangeSetEntity(aclChangeSetEntityId, commitTimeMs); if (updated != 1) { throw new ConcurrencyFailureException("Update by ID should delete exactly 1: " + aclChangeSetEntityId); } }
@Override public void setNodeAssocIndex(Long id, int assocIndex) { int updated = updateNodeAssoc(id, assocIndex); if (updated != 1) { throw new ConcurrencyFailureException("Expected to update exactly one row: " + id); } }
@Override public void setNodeAssocIndex(Long id, int assocIndex) { int updated = updateNodeAssoc(id, assocIndex); if (updated != 1) { throw new ConcurrencyFailureException("Expected to update exactly one row: " + id); } }
@Override public void deleteTenant(String tenantDomain) { ParameterCheck.mandatoryString("tenantDomain", tenantDomain); // force lower-case on delete tenantDomain = tenantDomain.toLowerCase(); int deleted = tenantEntityCache.deleteByKey(tenantDomain); if (deleted < 1) { throw new ConcurrencyFailureException("TenantEntity " + tenantDomain + " no longer exists"); } }
@Override public void deleteTenant(String tenantDomain) { ParameterCheck.mandatoryString("tenantDomain", tenantDomain); // force lower-case on delete tenantDomain = tenantDomain.toLowerCase(); int deleted = tenantEntityCache.deleteByKey(tenantDomain); if (deleted < 1) { throw new ConcurrencyFailureException("TenantEntity " + tenantDomain + " no longer exists"); } }
@Override protected PropertyRootEntity updatePropertyRoot(PropertyRootEntity entity) { entity.incrementVersion(); int updated = template.update(UPDATE_PROPERTY_ROOT, entity); if (updated != 1) { // unexpected number of rows affected throw new ConcurrencyFailureException("Incorrect number of rows affected for updatePropertyRoot: " + entity + ": expected 1, actual " + updated); } return entity; }
public void deleteAclChangeSet(Long changeSetId) { int deleted = deleteAclChangeSetEntity(changeSetId); if (deleted != 1) { aclEntityCache.removeByKey(changeSetId); throw new ConcurrencyFailureException("Deleted by ID should delete exactly 1: " + changeSetId); } }
@Override public Pair<Long, ChildAssociationRef> getChildAssoc(Long assocId) { ChildAssocEntity assoc = selectChildAssoc(assocId); if (assoc == null) { throw new ConcurrencyFailureException("Child association not found: " + assocId); } return assoc.getPair(qnameDAO); }
@Override protected PropertyUniqueContextEntity updatePropertyUniqueContext(PropertyUniqueContextEntity entity) { entity.incrementVersion(); int updated = template.update(UPDATE_PROPERTY_UNIQUE_CTX, entity); if (updated != 1) { // unexpected number of rows affected throw new ConcurrencyFailureException("Incorrect number of rows affected for updatePropertyUniqueContext: " + entity + ": expected 1, actual " + updated); } return entity; }
@Override protected PropertyUniqueContextEntity updatePropertyUniqueContext(PropertyUniqueContextEntity entity) { entity.incrementVersion(); int updated = template.update(UPDATE_PROPERTY_UNIQUE_CTX, entity); if (updated != 1) { // unexpected number of rows affected throw new ConcurrencyFailureException("Incorrect number of rows affected for updatePropertyUniqueContext: " + entity + ": expected 1, actual " + updated); } return entity; }
@Override public Pair<Long, ChildAssociationRef> getChildAssoc(Long assocId) { ChildAssocEntity assoc = selectChildAssoc(assocId); if (assoc == null) { throw new ConcurrencyFailureException("Child association not found: " + assocId); } return assoc.getPair(qnameDAO); }
@Override protected PropertyRootEntity updatePropertyRoot(PropertyRootEntity entity) { entity.incrementVersion(); int updated = template.update(UPDATE_PROPERTY_ROOT, entity); if (updated != 1) { // unexpected number of rows affected throw new ConcurrencyFailureException("Incorrect number of rows affected for updatePropertyRoot: " + entity + ": expected 1, actual " + updated); } return entity; }
@Override public void updateTenant(TenantUpdateEntity entity) { ParameterCheck.mandatory("entity", entity); ParameterCheck.mandatory("entity.version", entity.getVersion()); ParameterCheck.mandatoryString("entity.tenantDomain", entity.getTenantDomain()); int updated = tenantEntityCache.updateValue(entity.getTenantDomain(), entity); if (updated < 1) { throw new ConcurrencyFailureException("TenantEntity " + entity.getTenantDomain() + " no longer exists or has been updated concurrently"); } }
@Override public void updateTenant(TenantUpdateEntity entity) { ParameterCheck.mandatory("entity", entity); ParameterCheck.mandatory("entity.version", entity.getVersion()); ParameterCheck.mandatoryString("entity.tenantDomain", entity.getTenantDomain()); int updated = tenantEntityCache.updateValue(entity.getTenantDomain(), entity); if (updated < 1) { throw new ConcurrencyFailureException("TenantEntity " + entity.getTenantDomain() + " no longer exists or has been updated concurrently"); } }