diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataBO.java index 47ffc587e462b61a02f67a87379a997c30c3b570..a27b5c967fe12ad6df0b9648ea1ffb2835e0c649 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataBO.java @@ -631,9 +631,13 @@ public class DataBO extends AbstractDataSetBusinessObject implements IDataBO entityPropertiesConverter.checkMandatoryProperties(data.getProperties(), data.getDataSetType()); - this.getSessionFactory().getCurrentSession().evict(data); - this.getSessionFactory().getCurrentSession().update(data); + + data.setModificationDate(new Date(data.getModificationDate().getTime() + 1)); validateAndSave(); + + data.setModificationDate(new Date(data.getModificationDate().getTime() - 1)); + validateAndSave(); + } private List<String> asListOrNull(String[] arrayOrNull) diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AbstractAssignmentSampleToExperimentTestCase.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AbstractAssignmentSampleToExperimentTestCase.java index 9f83e1409d16584a76e54ff57f55dbe69bef29b5..07347fa5cc9ee20399ddbace8061f78ea900163c 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AbstractAssignmentSampleToExperimentTestCase.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AbstractAssignmentSampleToExperimentTestCase.java @@ -84,11 +84,16 @@ public abstract class AbstractAssignmentSampleToExperimentTestCase extends BaseT AuthorizationRule assignSharedSampleToExperimentRule; - + private static boolean fixtureRun = false; + @BeforeClass(dependsOnMethods = "loginAsSystem") void createFixture() throws Exception { - sourceSpace = create(aSpace().withCode("sourceSpace")); + if (fixtureRun) { + return; + } + + sourceSpace = create(aSpace().withCode("sourceSpace")); destinationSpace = create(aSpace().withCode("destinationSpace")); sourceProject = create(aProject().inSpace(sourceSpace)); @@ -125,6 +130,8 @@ public abstract class AbstractAssignmentSampleToExperimentTestCase extends BaseT assignSharedSampleToExperimentRule = and(rule(destination, RoleWithHierarchy.SPACE_USER), rule(instance, RoleWithHierarchy.INSTANCE_ETL_SERVER)); + + fixtureRun = true; } @DataProvider