diff --git a/dbmigration/source/java/ch/systemsx/cisd/dbmigration/BasicDataSourceFactory.java b/dbmigration/source/java/ch/systemsx/cisd/dbmigration/BasicDataSourceFactory.java
index 0f5a8db56940439f1140c015d8d33129761d2c84..a70b7c4e4fb531a97d0b8f7eb2f3b2e31d73568b 100644
--- a/dbmigration/source/java/ch/systemsx/cisd/dbmigration/BasicDataSourceFactory.java
+++ b/dbmigration/source/java/ch/systemsx/cisd/dbmigration/BasicDataSourceFactory.java
@@ -33,6 +33,8 @@ public class BasicDataSourceFactory implements IDataSourceFactory
     /** @see GenericObjectPool#DEFAULT_MAX_IDLE */
     private final int DEFAULT_MAX_IDLE = DEFAULT_MAX_ACTIVE;
 
+    private long maxWait = GenericObjectPool.DEFAULT_MAX_WAIT;
+
     private int maxIdle = DEFAULT_MAX_IDLE;
 
     private int maxActive = DEFAULT_MAX_ACTIVE;
@@ -51,9 +53,15 @@ public class BasicDataSourceFactory implements IDataSourceFactory
         dataSource.setPassword(password);
         dataSource.setMaxIdle(maxIdle);
         dataSource.setMaxActive(maxActive);
+        dataSource.setMaxWait(maxWait);
         return dataSource;
     }
 
+    public void setMaxWait(long maxWait)
+    {
+        this.maxWait = maxWait;
+    }
+
     public void setMaxIdle(int maxIdle)
     {
         this.maxIdle = maxIdle;
diff --git a/dbmigration/source/java/ch/systemsx/cisd/dbmigration/DatabaseConfigurationContext.java b/dbmigration/source/java/ch/systemsx/cisd/dbmigration/DatabaseConfigurationContext.java
index 02bc4af51c47d9de66436ca7c4278f81683169bc..5231c63f57bae064bc90a60e3c8872ecaf408acb 100644
--- a/dbmigration/source/java/ch/systemsx/cisd/dbmigration/DatabaseConfigurationContext.java
+++ b/dbmigration/source/java/ch/systemsx/cisd/dbmigration/DatabaseConfigurationContext.java
@@ -391,6 +391,16 @@ public class DatabaseConfigurationContext implements DisposableBean
         }
     }
 
+    /**
+     * The maximum number of milliseconds that the pool will wait (when there are no available
+     * connections) for a connection to be returned before throwing an exception, or -1 (by default)
+     * to wait indefinitely.
+     */
+    public void setMaxWait(long maxWait)
+    {
+        this.dataSourceFactory.setMaxWait(maxWait);
+    }
+
     /**
      * Sets the maximum number of idle connections in the pool (default is 20).
      */
diff --git a/dbmigration/source/java/ch/systemsx/cisd/dbmigration/IDataSourceFactory.java b/dbmigration/source/java/ch/systemsx/cisd/dbmigration/IDataSourceFactory.java
index 39d73c62e4e912828241a148223c3b51f88235bb..b97d14ad809a62c7b1e8df89fa0700924de74c69 100644
--- a/dbmigration/source/java/ch/systemsx/cisd/dbmigration/IDataSourceFactory.java
+++ b/dbmigration/source/java/ch/systemsx/cisd/dbmigration/IDataSourceFactory.java
@@ -44,4 +44,10 @@ public interface IDataSourceFactory
      * @see GenericObjectPool#DEFAULT_MAX_ACTIVE
      */
     public void setMaxActive(int maxActive);
+
+    /**
+     * @see BasicDataSource#setMaxWait(long)
+     * @see GenericObjectPool#DEFAULT_MAX_WAIT
+     */
+    public void setMaxWait(long maxWait);
 }
diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SqlUnitMigrationTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SqlUnitMigrationTest.java
index 9244725886d0287bbbbb84d4ad659dcfd28d1e79..dfe55683fe7f75720f948b2ca2dced1d05c967df 100644
--- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SqlUnitMigrationTest.java
+++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SqlUnitMigrationTest.java
@@ -174,6 +174,10 @@ public final class SqlUnitMigrationTest
             public void setMaxIdle(int maxIdle)
             {
             }
+
+            public void setMaxWait(long maxWait)
+            {
+            }
         };
 
     @BeforeClass(alwaysRun = true)