Mercurial > lada > lada-server
changeset 99:bd5c69c4b769
Catch Rollback Exception.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Tue, 11 Jun 2013 11:12:26 +0200 |
parents | 7373563fdb51 |
children | 4ed15ffbc20c |
files | src/main/java/de/intevation/lada/data/LProbeRepository.java src/main/java/de/intevation/lada/manage/LProbeManager.java |
diffstat | 2 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/data/LProbeRepository.java Tue Jun 11 11:11:18 2013 +0200 +++ b/src/main/java/de/intevation/lada/data/LProbeRepository.java Tue Jun 11 11:12:26 2013 +0200 @@ -3,6 +3,7 @@ import java.util.Date; import java.util.List; +import javax.ejb.EJBTransactionRolledbackException; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; import javax.inject.Named; @@ -122,6 +123,10 @@ response.setErrors(ve.getErrors()); response.setWarnings(validator.getWarnings()); } + catch (EJBTransactionRolledbackException te) { + response.setSuccess(false); + response.setMessage(604); + } return response; }
--- a/src/main/java/de/intevation/lada/manage/LProbeManager.java Tue Jun 11 11:11:18 2013 +0200 +++ b/src/main/java/de/intevation/lada/manage/LProbeManager.java Tue Jun 11 11:12:26 2013 +0200 @@ -3,6 +3,7 @@ import java.util.Map; import java.util.logging.Logger; +import javax.ejb.EJBTransactionRolledbackException; import javax.ejb.Stateless; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; @@ -56,6 +57,7 @@ public void create(LProbe probe) throws EntityExistsException, IllegalArgumentException, + EJBTransactionRolledbackException, TransactionRequiredException { em.persist(probe); }