diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/MultiThreadSampleOptimisticLockingTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/MultiThreadSampleOptimisticLockingTest.java
index bcbde898c6d1acee4361129cf232883a500eed72..16e1abc69bc3632e3e68f763847be6883fc09145 100644
--- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/MultiThreadSampleOptimisticLockingTest.java
+++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/MultiThreadSampleOptimisticLockingTest.java
@@ -47,14 +47,14 @@ public class MultiThreadSampleOptimisticLockingTest extends MultiThreadOptimisti
             MultiThreadSampleOptimisticLockingTest.class);
 
     @Test
-    public void testRegisterSamplesForSameSampleInTwoThreads()
+    public void testRegisterChildSamplesForSameSampleInTwoThreads()
     {
         final Sample sample = toolBox.createAndLoadSample(1, null);
         final MessageChannel messageChannelMain =
-                new MessageChannelBuilder(10000).name("data sets for samples main")
+                new MessageChannelBuilder(10000).name("child samples for samples main")
                         .logger(operationLog).getChannel();
         final MessageChannel messageChannelSecond =
-                new MessageChannelBuilder(10000).name("data sets for samples second")
+                new MessageChannelBuilder(10000).name("child samples for samples second")
                         .logger(operationLog).getChannel();
         final IServiceConversationProgressListener listener =
                 new AbstractServiceConversationProgressListener(operationLog)
@@ -102,6 +102,63 @@ public class MultiThreadSampleOptimisticLockingTest extends MultiThreadOptimisti
 
     }
 
+    @Test
+    public void testRegisterContainedSamplesForSameSampleInTwoThreads()
+    {
+        final Sample sample = toolBox.createAndLoadSample(1, null);
+        final MessageChannel messageChannelMain =
+                new MessageChannelBuilder(10000).name("contained samples for samples main")
+                        .logger(operationLog).getChannel();
+        final MessageChannel messageChannelSecond =
+                new MessageChannelBuilder(10000).name("contained samples for samples second")
+                        .logger(operationLog).getChannel();
+        final IServiceConversationProgressListener listener =
+                new AbstractServiceConversationProgressListener(operationLog)
+                    {
+                        @Override
+                        public void handleProgress(String phaseName, int totalItemsToProcess,
+                                int numItemsProcessed)
+                        {
+                            if (phaseName.equals("createContainerSamples")
+                                    && numItemsProcessed == 1 && totalItemsToProcess == 2)
+                            {
+                                messageChannelMain.send(ToolBox.FIRST_REGISTERED);
+                            }
+                        }
+                    };
+        TimeIntervalChecker timeIntervalChecker = new TimeIntervalChecker();
+        new Thread(new Runnable()
+            {
+                @Override
+                public void run()
+                {
+                    messageChannelMain.assertNextMessage(ToolBox.FIRST_REGISTERED);
+                    AtomicEntityOperationDetails details =
+                            new AtomicEntityOperationDetailsBuilder().user("test")
+                                    .sample(toolBox.sampleComponent(13, sample)).getDetails();
+                    etlService.performEntityOperations(systemSessionToken, details);
+                    messageChannelSecond.send(ToolBox.REGISTERED);
+                }
+            }).start();
+        ServiceConversationsThreadContext.setProgressListener(listener);
+        AtomicEntityOperationDetailsBuilder builder = new AtomicEntityOperationDetailsBuilder();
+        builder.user(ToolBox.USER_ID).batchSize(1);
+        builder.sample(toolBox.sampleComponent(11, sample));
+        builder.sample(toolBox.sampleComponent(12, sample));
+
+        etlService.performEntityOperations(systemSessionToken, builder.getDetails());
+        messageChannelSecond.assertNextMessage(ToolBox.REGISTERED);
+
+        Sample loadedSample = toolBox.loadSample(sample);
+        List<Sample> samples =
+                etlService.listSamples(systemSessionToken,
+                        ListSampleCriteria.createForContainer(new TechId(loadedSample)));
+        assertEquals("[OLT-S1:OLT-S11, OLT-S1:OLT-S12, OLT-S1:OLT-S13]",
+                toolBox.extractCodes(samples).toString());
+        toolBox.checkModifierAndModificationDateOfBean(timeIntervalChecker, loadedSample, "test");
+
+    }
+
     @Test
     public void testRegisterDataSetsForSameSampleInTwoThreads()
     {
diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/ToolBox.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/ToolBox.java
index 7b33e0e8a09c76962d5b6915fa038a080e670dc6..a9efbfbef3b7f6d108b25f2871fe71928e52aae5 100644
--- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/ToolBox.java
+++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/ToolBox.java
@@ -327,6 +327,14 @@ public class ToolBox
         return sample;
     }
 
+    public NewSample sampleComponent(int number, IIdentifierHolder sampleContainer,
+            IEntityProperty... properties)
+    {
+        NewSample sample = sample(number, properties);
+        sample.setContainerIdentifier(sampleContainer.getIdentifier());
+        return sample;
+    }
+
     public NewSample sample(int number, IEntityProperty... properties)
     {
         NewSample sample = new NewSample();