diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataAccessExceptionTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataAccessExceptionTranslator.java
index 4bd041ac8fcd7cbd2083865a78ef3d856ae6347d..02f63f13a9a5b74af371b8099848689a2b6445c5 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataAccessExceptionTranslator.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataAccessExceptionTranslator.java
@@ -54,7 +54,7 @@ public final class DataAccessExceptionTranslator
     public final static String DETAILED_FOREIGN_KEY_VIOLATION_FORMAT =
             FOREIGN_KEY_VIOLATION_FORMAT
                     + " To find out which exactly objects are connected to this object "
-                    + "go to it's Detail view or use Search.";
+                    + "go to its Detail view or use Search.";
 
     private DataAccessExceptionTranslator()
     {
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleBO.java
index 7adc69dbb29047d4ab1dae4f3041b28072e325c0..cd8f86dbfa698938a6098982bdf1dd6ea54dac8f 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleBO.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleBO.java
@@ -21,6 +21,7 @@ import java.util.List;
 import java.util.Set;
 
 import org.springframework.dao.DataAccessException;
+import org.springframework.dao.DataIntegrityViolationException;
 
 import ch.systemsx.cisd.common.exceptions.UserFailureException;
 import ch.systemsx.cisd.openbis.generic.server.business.bo.util.SampleOwner;
@@ -179,6 +180,10 @@ public final class SampleBO extends AbstractSampleBusinessObject implements ISam
             try
             {
                 getSampleDAO().createSample(sample);
+            } catch (final DataIntegrityViolationException ex)
+            {
+                // needed because we throw an exception in DAO instead of relying on DB constraint
+                throw UserFailureException.fromTemplate(ex.getMessage());
             } catch (final DataAccessException ex)
             {
                 throwException(ex, String.format("Sample '%s'", sample.getSampleIdentifier()));
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SampleDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SampleDAO.java
index 81e7bb687856f258de2ef99a8739626b2d837d42..f1c0553094a6908081703e746a01b61dcb32fd53 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SampleDAO.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SampleDAO.java
@@ -16,6 +16,7 @@
 
 package ch.systemsx.cisd.openbis.generic.server.dataaccess.db;
 
+import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -27,11 +28,14 @@ import org.hibernate.criterion.Criterion;
 import org.hibernate.criterion.Restrictions;
 import org.hibernate.validator.ClassValidator;
 import org.springframework.dao.DataAccessException;
+import org.springframework.dao.DataIntegrityViolationException;
+import org.springframework.jdbc.UncategorizedSQLException;
 import org.springframework.jdbc.support.JdbcAccessor;
 import org.springframework.orm.hibernate3.HibernateTemplate;
 
 import ch.systemsx.cisd.common.logging.LogCategory;
 import ch.systemsx.cisd.common.logging.LogFactory;
+import ch.systemsx.cisd.common.utilities.ExceptionUtils;
 import ch.systemsx.cisd.openbis.generic.server.dataaccess.ISampleDAO;
 import ch.systemsx.cisd.openbis.generic.shared.dto.CodeConverter;
 import ch.systemsx.cisd.openbis.generic.shared.dto.DatabaseInstancePE;
@@ -172,7 +176,23 @@ public class SampleDAO extends AbstractGenericEntityDAO<SamplePE> implements ISa
 
         internalCreateSample(sample, hibernateTemplate,
                 new ClassValidator<SamplePE>(SamplePE.class), true);
-        hibernateTemplate.flush();
+        try
+        {
+            hibernateTemplate.flush();
+        } catch (UncategorizedSQLException e)
+        {
+            // need to deal with exception thrown by trigger checking code uniqueness
+            final SQLException sqlExceptionOrNull =
+                    ExceptionUtils.tryGetThrowableOfClass(e, SQLException.class);
+            if (sqlExceptionOrNull != null && sqlExceptionOrNull.getNextException() != null)
+            {
+                throw new DataIntegrityViolationException(sqlExceptionOrNull.getNextException()
+                        .getMessage());
+            } else
+            {
+                throw e;
+            }
+        }
     }
 
     public List<SamplePE> listSamplesWithPropertiesByExperiment(final ExperimentPE experiment)