From 07c164a7c37a525ac94482caa165033c69391eea Mon Sep 17 00:00:00 2001 From: Przemyslaw Kornowski Date: Fri, 27 Jan 2017 09:07:51 +0100 Subject: [PATCH] MOTECH-3118: Deleted unnecessary Transactional annotations. --- .../openmrs/service/impl/OpenMRSConfigServiceImpl.java | 3 --- .../openmrs/service/impl/OpenMRSPatientServiceImpl.java | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/openmrs/src/main/java/org/motechproject/openmrs/service/impl/OpenMRSConfigServiceImpl.java b/openmrs/src/main/java/org/motechproject/openmrs/service/impl/OpenMRSConfigServiceImpl.java index 670d09770..d70d27918 100644 --- a/openmrs/src/main/java/org/motechproject/openmrs/service/impl/OpenMRSConfigServiceImpl.java +++ b/openmrs/src/main/java/org/motechproject/openmrs/service/impl/OpenMRSConfigServiceImpl.java @@ -111,13 +111,11 @@ public void markConfigAsDefault(String name) { } @Override - @Transactional public Configs getConfigs() { return configs; } @Override - @Transactional public Config getConfigByName(String name) { Config config = StringUtils.isEmpty(name) ? configs.getByName(configs.getDefaultConfigName()) : configs.getByName(name); @@ -130,7 +128,6 @@ public Config getConfigByName(String name) { } @Override - @Transactional public Config getDefaultConfig() { return configs.getByName(configs.getDefaultConfigName()); } diff --git a/openmrs/src/main/java/org/motechproject/openmrs/service/impl/OpenMRSPatientServiceImpl.java b/openmrs/src/main/java/org/motechproject/openmrs/service/impl/OpenMRSPatientServiceImpl.java index 8bde1392e..4b10b9e46 100644 --- a/openmrs/src/main/java/org/motechproject/openmrs/service/impl/OpenMRSPatientServiceImpl.java +++ b/openmrs/src/main/java/org/motechproject/openmrs/service/impl/OpenMRSPatientServiceImpl.java @@ -69,6 +69,10 @@ public Patient createPatient(String configName, Patient patient) { personResource.checkPersonAttributeTypes(config, patient.getPerson()); patient.setPerson(personResource.createPerson(config, patient.getPerson())); } catch (HttpClientErrorException e) { + if(StringUtils.equals("401 Unauthorized", e.getMessage())) { + LOGGER.info(String.format("%s: User: %s Password: %s.\n", e.getMessage(), config.getUsername(), config.getPassword())); + } + throw new OpenMRSException(String.format("Could not create Person. %s %s", e.getMessage(), e.getResponseBodyAsString()), e); } }