LOG.debug("Timing out request after duration: " + duration + " Request: " + request); request.setErrorMessage("Request with duration " + duration + " exceeded the timeout threshold of " + REQUEST_TIMEOUT); request.setStatus(CreateResourceStatus.TIMED_OUT);
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public void completeCreateResource(CreateResourceResponse response) { if (LOG.isDebugEnabled()) { LOG.debug("Received call to complete create resource: " + response); } // Load the persisted history entry CreateResourceHistory history = entityManager.find(CreateResourceHistory.class, response.getRequestId()); // There is some inconsistency if we're completing a request that was not in the database if (history == null) { LOG.error("Attempting to complete a request that was not found in the database: " + response.getRequestId()); return; } // Update the history entry history.setNewResourceKey(response.getResourceKey()); history.setErrorMessage(response.getErrorMessage()); history.setStatus(response.getStatus()); // The configuration may now have error messages in it, so merge with the persisted one if (response.getResourceConfiguration() != null) { entityManager.merge(response.getResourceConfiguration()); } }