return new ConcurrencyFailureException(buildMessage(task, sql, ex), ex);
assertEquals(tranRollbackEx, cfex.getCause());
ConcurrencyException ce = new ConcurrencyException(cfe.getMessage(), 500); ce.setStackTrace(t.getStackTrace()); printException("Unknown concurrency failure", t); ConcurrencyException ce = new ConcurrencyException(cfe.getMessage(), 500); ce.setStackTrace(t.getStackTrace()); printException("Unknown transient failure", t);
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 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 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 Pair<Long, AssociationRef> getNodeAssoc(Long assocId) { Pair<Long, AssociationRef> ret = getNodeAssocOrNull(assocId); if (ret == null) { throw new ConcurrencyFailureException("Assoc ID does not point to a valid association: " + assocId); } else { return ret; } }
@Override public Pair<Long, AssociationRef> getNodeAssoc(Long assocId) { Pair<Long, AssociationRef> ret = getNodeAssocOrNull(assocId); if (ret == null) { throw new ConcurrencyFailureException("Assoc ID does not point to a valid association: " + assocId); } else { return ret; } }
@Override public void deleteContentData(Long id) { if (id == null) { throw new IllegalArgumentException("Cannot delete ContentData by null ID."); } int deleted = contentDataCache.deleteByKey(id); if (deleted < 1) { throw new ConcurrencyFailureException("ContentData with ID " + id + " no longer exists"); } return; }
@Override public void deleteContentData(Long id) { if (id == null) { throw new IllegalArgumentException("Cannot delete ContentData by null ID."); } int deleted = contentDataCache.deleteByKey(id); if (deleted < 1) { throw new ConcurrencyFailureException("ContentData with ID " + id + " no longer exists"); } return; }
@Override public int removeNodeAssocs(List<Long> ids) { int toDelete = ids.size(); if (toDelete == 0) { return 0; } int deleted = deleteNodeAssocs(ids); if (toDelete != deleted) { throw new ConcurrencyFailureException("Deleted " + deleted + " but expected " + toDelete); } return deleted; }
public Long execute() throws Throwable { callCount++; Long checkValue = incrementCheckValue(); if (callCount == maxCalls) { return checkValue; } else { throw new ConcurrencyFailureException("Testing"); } } };
@Override public int removeNodeAssocs(List<Long> ids) { int toDelete = ids.size(); if (toDelete == 0) { return 0; } int deleted = deleteNodeAssocs(ids); if (toDelete != deleted) { throw new ConcurrencyFailureException("Deleted " + deleted + " but expected " + toDelete); } return deleted; }
@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"); } }