diff --git a/datastore_server/dist/etc/service.properties b/datastore_server/dist/etc/service.properties
index 56cc0500b03e14cede9d5146a2c2da1020a95d04..120c6634351bc4ff1ad2717b6928d4dc3315ce9e 100644
--- a/datastore_server/dist/etc/service.properties
+++ b/datastore_server/dist/etc/service.properties
@@ -39,9 +39,6 @@ notify-successful-registration = false
 # The URL of the openBIS server
 server-url = https://localhost:8443/openbis/openbis
 
-# The URL of the CIFEX server
-cifex-url = https://cifex.ethz.ch/
-
 # The username to use when contacting the openBIS server
 username = etlserver
 
diff --git a/datastore_server/etc/service.properties b/datastore_server/etc/service.properties
index 37c5a19825603bb47e0d80cc036a41bc9cea9e2a..36f8e8ab5631c842f7b079f09540936153bc0513 100644
--- a/datastore_server/etc/service.properties
+++ b/datastore_server/etc/service.properties
@@ -37,9 +37,6 @@ notify-successful-registration = false
 # The URL of the openBIS server
 server-url = http://localhost:8080/openbis
 
-# The URL of the CIFEX server
-cifex-url = https://cifex.ethz.ch/
-
 # The username to use when contacting the openBIS server
 username = etlserver
 
diff --git a/datastore_server/source/java/applicationContext.xml b/datastore_server/source/java/applicationContext.xml
index 4a1b06b3c56d25fdd8304681d14b76b0dd7d3bec..b0b9320176905673fb7e61cff907a77a0b8847f6 100644
--- a/datastore_server/source/java/applicationContext.xml
+++ b/datastore_server/source/java/applicationContext.xml
@@ -32,7 +32,6 @@
         <property name="service">
             <bean class="ch.systemsx.cisd.openbis.dss.generic.server.DataStoreService">
                 <constructor-arg ref="session-token-manager" />
-                <constructor-arg value="${cifex-url}"/>
                 <property name="storeRoot" value="${storeroot-dir}"/>
             </bean>
         </property>
diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/DataStoreService.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/DataStoreService.java
index cfde5c35271bb9087b28a8383e3fba4cddcd9300..f17ab8f445a7c3489da103d8618859d2a66ec4a9 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/DataStoreService.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/DataStoreService.java
@@ -26,11 +26,13 @@ import org.springframework.beans.factory.InitializingBean;
 import ch.systemsx.cisd.cifex.rpc.ICIFEXRPCService;
 import ch.systemsx.cisd.cifex.rpc.client.RPCServiceFactory;
 import ch.systemsx.cisd.cifex.shared.basic.Constants;
+import ch.systemsx.cisd.common.exceptions.EnvironmentFailureException;
 import ch.systemsx.cisd.common.exceptions.InvalidAuthenticationException;
 import ch.systemsx.cisd.common.exceptions.InvalidSessionException;
 import ch.systemsx.cisd.common.exceptions.WrappedIOException;
 import ch.systemsx.cisd.common.spring.AbstractServiceWithLogger;
 import ch.systemsx.cisd.openbis.generic.shared.IDataStoreService;
+import ch.systemsx.cisd.openbis.generic.shared.dto.DataSetUploadContext;
 
 /**
  * Implementation of {@link IDataStoreService} which will be accessed remotely by the opneBIS
@@ -41,21 +43,6 @@ import ch.systemsx.cisd.openbis.generic.shared.IDataStoreService;
 public class DataStoreService extends AbstractServiceWithLogger<IDataStoreService> implements
         IDataStoreService, InitializingBean
 {
-    private static ICIFEXRPCService createCIFEXService(String baseURL)
-    {
-        final String serviceURL = baseURL + Constants.CIFEX_RPC_PATH;
-        final ICIFEXRPCService service =
-                RPCServiceFactory.createServiceProxy(serviceURL, true);
-        final int serverVersion = service.getVersion();
-        if (ICIFEXRPCService.VERSION != serverVersion)
-        {
-            System.err.println("This client has the wrong service version for the server (client: "
-                    + ICIFEXRPCService.VERSION + ", server: " + serverVersion + ").");
-            return null;
-        }
-        return service;
-    }
-    
     private final SessionTokenManager sessionTokenManager;
     
     private final IDataSetCommandExecutorFactory commandExecutorFactory;
@@ -64,25 +51,22 @@ public class DataStoreService extends AbstractServiceWithLogger<IDataStoreServic
 
     private IDataSetCommandExecutor commandExecuter;
 
-    private final ICIFEXRPCService cifexService;
-
-    public DataStoreService(SessionTokenManager sessionTokenManager, String baseURL)
+    public DataStoreService(SessionTokenManager sessionTokenManager)
     {
         this(sessionTokenManager, new IDataSetCommandExecutorFactory()
             {
                 public IDataSetCommandExecutor create(File store)
                 {
-                    return new DataSetCommandExecuter(new File(store, "commandQueue"));
+                    return new DataSetCommandExecuter(store);
                 }
-            }, createCIFEXService(baseURL));
+            });
     }
 
     DataStoreService(SessionTokenManager sessionTokenManager,
-            IDataSetCommandExecutorFactory commandExecutorFactory, ICIFEXRPCService cifexService)
+            IDataSetCommandExecutorFactory commandExecutorFactory)
     {
         this.sessionTokenManager = sessionTokenManager;
         this.commandExecutorFactory = commandExecutorFactory;
-        this.cifexService = cifexService;
     }
 
     public final void setStoreRoot(File storeRoot)
@@ -162,16 +146,48 @@ public class DataStoreService extends AbstractServiceWithLogger<IDataStoreServic
     }
 
     public void uploadDataSetsToCIFEX(String sessionToken, List<String> dataSetLocations,
-            String comment, String userID, String password) throws InvalidAuthenticationException
+            DataSetUploadContext context) throws InvalidAuthenticationException
     {
         sessionTokenManager.assertValidSessionToken(sessionToken);
 
-        if (cifexService.login(userID, password) == null)
+        CIFEXRPCServiceFactory serviceFactory = new CIFEXRPCServiceFactory(context.getCifexURL());
+        ICIFEXRPCService service = serviceFactory.createService();
+        String userID = context.getUserID();
+        String password = context.getPassword();
+        if (service.login(userID, password) == null)
         {
             throw new InvalidSessionException("User couldn't be authenticated at CIFEX.");
         }
-        commandExecuter.scheduleCommand(new UploadingCommand(cifexService, dataSetLocations,
-                comment, userID, password));
+        commandExecuter.scheduleCommand(new UploadingCommand(serviceFactory, dataSetLocations, context));
     }
 
+    private static final class CIFEXRPCServiceFactory implements ICIFEXRPCServiceFactory
+    {
+        private static final long serialVersionUID = 1L;
+        private final String cifexURL;
+        
+        private transient ICIFEXRPCService service;
+        
+        CIFEXRPCServiceFactory(String cifexURL)
+        {
+            this.cifexURL = cifexURL;
+        }
+
+        public ICIFEXRPCService createService()
+        {
+            if (service == null)
+            {
+                final String serviceURL = cifexURL + Constants.CIFEX_RPC_PATH;
+                service = RPCServiceFactory.createServiceProxy(serviceURL, true);
+                final int serverVersion = service.getVersion();
+                if (ICIFEXRPCService.VERSION != serverVersion)
+                {
+                    throw new EnvironmentFailureException("The version of the CIFEX server is not "
+                            + ICIFEXRPCService.VERSION + " but " + serverVersion + ".");
+                }
+            }
+            return service;
+        }
+    }
+    
 }
diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/DataStoreServiceLogger.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/DataStoreServiceLogger.java
index acd78f7599524652acc91843c0657e83e63386ee..f4b7ca8cba3e31e0182b889cbb57c9933bc46b85 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/DataStoreServiceLogger.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/DataStoreServiceLogger.java
@@ -22,6 +22,7 @@ import org.apache.log4j.Logger;
 
 import ch.systemsx.cisd.common.exceptions.InvalidAuthenticationException;
 import ch.systemsx.cisd.openbis.generic.shared.IDataStoreService;
+import ch.systemsx.cisd.openbis.generic.shared.dto.DataSetUploadContext;
 
 /**
  * 
@@ -83,9 +84,9 @@ class DataStoreServiceLogger implements IDataStoreService
     }
 
     public void uploadDataSetsToCIFEX(String sessionToken, List<String> dataSetLocations,
-            String comment, String userID, String password) throws InvalidAuthenticationException
+            DataSetUploadContext context) throws InvalidAuthenticationException
     {
-        log("upload_data_sets", "LOCATIONS(%s) USER(%s) COMMENT(%s)", dataSetLocations, userID, comment);
+        log("upload_data_sets", "LOCATIONS(%s) USER(%s)", dataSetLocations, context.getUserID());
     }
 
 }
diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/ICIFEXRPCServiceFactory.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/ICIFEXRPCServiceFactory.java
new file mode 100644
index 0000000000000000000000000000000000000000..4414a198317223fc91dc2e847aa17811fe160d77
--- /dev/null
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/ICIFEXRPCServiceFactory.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2009 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.dss.generic.server;
+
+import java.io.Serializable;
+
+import ch.systemsx.cisd.cifex.rpc.ICIFEXRPCService;
+
+/**
+ * 
+ *
+ * @author Franz-Josef Elmer
+ */
+public interface ICIFEXRPCServiceFactory extends Serializable
+{
+    public ICIFEXRPCService createService();
+}
diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/UploadingCommand.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/UploadingCommand.java
index dd00ef5f85befdd7a03fe94e4c73727ad178a7b6..026a74554c21a17871b2263effaa8fe7743befe5 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/UploadingCommand.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/UploadingCommand.java
@@ -36,6 +36,7 @@ import ch.systemsx.cisd.cifex.shared.basic.Constants;
 import ch.systemsx.cisd.common.logging.LogCategory;
 import ch.systemsx.cisd.common.logging.LogFactory;
 import ch.systemsx.cisd.common.utilities.TokenGenerator;
+import ch.systemsx.cisd.openbis.generic.shared.dto.DataSetUploadContext;
 
 /**
  * 
@@ -98,21 +99,21 @@ class UploadingCommand implements IDataSetCommand
     private static final Logger notificationLog =
         LogFactory.getLogger(LogCategory.NOTIFY, UploadingCommand.class);
     
-    private final ICIFEXRPCService cifexService;
+    private final ICIFEXRPCServiceFactory cifexServiceFactory;
     private final List<String> dataSetLocations;
     private final String comment;
     private final String userID;
     private final String password;
     private final TokenGenerator tokenGenerator;
 
-    UploadingCommand(ICIFEXRPCService cifexService, List<String> dataSetLocations, String comment,
-            String userID, String password)
+    UploadingCommand(ICIFEXRPCServiceFactory cifexServiceFactory, List<String> dataSetLocations,
+            DataSetUploadContext context)
     {
-        this.cifexService = cifexService;
+        this.cifexServiceFactory = cifexServiceFactory;
         this.dataSetLocations = dataSetLocations;
-        this.userID = userID;
-        this.password = password;
-        this.comment = comment;
+        this.userID = context.getUserID();
+        this.password = context.getPassword();
+        this.comment = context.getComment();
         tokenGenerator = new TokenGenerator();
     }
 
@@ -130,6 +131,7 @@ class UploadingCommand implements IDataSetCommand
                 operationLog.info("Zip file " + zipFile + " with " + dataSetLocations.size()
                         + " data sets has been successfully created.");
             }
+            ICIFEXRPCService cifexService = cifexServiceFactory.createService();
             String sessionToken = cifexService.login(userID, password);
             Uploader uploader = new Uploader(cifexService, sessionToken);
             uploader.addProgressListener(new ProgressListener(zipFile));
@@ -199,11 +201,13 @@ class UploadingCommand implements IDataSetCommand
                 IOUtils.closeQuietly(in);
                 zipOutputStream.closeEntry();
             }
-        }
-        File[] files = file.listFiles();
-        for (File childFile : files)
+        } else
         {
-            addTo(zipOutputStream, childFile);
+            File[] files = file.listFiles();
+            for (File childFile : files)
+            {
+                addTo(zipOutputStream, childFile);
+            }
         }
     }