diff --git a/src/adql/db/DBChecker.java b/src/adql/db/DBChecker.java
index 62db0555d7741ee15f21ee101c61dbcffd0e43ff..cdc6dc59997d22f9e0873fed85edd45f37e1fc1c 100644
--- a/src/adql/db/DBChecker.java
+++ b/src/adql/db/DBChecker.java
@@ -17,7 +17,7 @@ package adql.db;
  * along with ADQLLibrary.  If not, see <http://www.gnu.org/licenses/>.
  * 
  * Copyright 2011,2013-2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS),
- *                            Astronomishes Rechen Institute (ARI)
+ *                            Astronomishes Rechen Institut (ARI)
  */
 
 import java.util.ArrayList;
@@ -64,7 +64,7 @@ import adql.search.SimpleSearchHandler;
  * </i></p>
  * 
  * @author Gr&eacute;gory Mantelet (CDS;ARI)
- * @version 1.2 (04/2014)
+ * @version 1.3 (08/2014)
  */
 public class DBChecker implements QueryChecker {
 
@@ -86,7 +86,7 @@ public class DBChecker implements QueryChecker {
 	 * 
 	 * @param tables	List of all available tables.
 	 */
-	public DBChecker(final Collection<DBTable> tables){
+	public DBChecker(final Collection<? extends DBTable> tables){
 		setTables(tables);
 	}
 
@@ -103,7 +103,7 @@ public class DBChecker implements QueryChecker {
 	 * 
 	 * @param tables	List of {@link DBTable}s.
 	 */
-	public final void setTables(final Collection<DBTable> tables){
+	public final void setTables(final Collection<? extends DBTable> tables){
 		if (tables == null)
 			lstTables = new SearchTableList();
 		else if (tables instanceof SearchTableList)
diff --git a/src/adql/parser/QueryChecker.java b/src/adql/parser/QueryChecker.java
index 0c15a16d9b86e8d11fa80c5aae25428a2b42e705..dec0c618926f409650ecc98124a786813b052f9a 100644
--- a/src/adql/parser/QueryChecker.java
+++ b/src/adql/parser/QueryChecker.java
@@ -17,7 +17,7 @@ package adql.parser;
  * along with ADQLLibrary.  If not, see <http://www.gnu.org/licenses/>.
  * 
  * Copyright 2012-2013 - UDS/Centre de Données astronomiques de Strasbourg (CDS),
- *                       Astronomisches Rechen Institute (ARI)
+ *                       Astronomisches Rechen Institut (ARI)
  */
 
 import adql.db.DBChecker;
diff --git a/src/cds/utils/TextualSearchList.java b/src/cds/utils/TextualSearchList.java
index dfbff861dff639e2e287660ad31c36893d57ac73..3dd9888b0f0f866f36f2a590c9cf09dcc2d78b4c 100644
--- a/src/cds/utils/TextualSearchList.java
+++ b/src/cds/utils/TextualSearchList.java
@@ -17,7 +17,7 @@ package cds.utils;
  * along with ADQLLibrary.  If not, see <http://www.gnu.org/licenses/>.
  * 
  * Copyright 2012-2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS),
- *                       Astronomisches Rechen Institute (ARI)
+ *                       Astronomisches Rechen Institut (ARI)
  */
 
 import java.util.ArrayList;
diff --git a/src/tap/ADQLExecutor.java b/src/tap/ADQLExecutor.java
index 93a8dc336354c1a2eb20ded437dfb4d13c4b1365..c4785179dfa963fc071d9997bccf2fa4d5a01ad8 100644
--- a/src/tap/ADQLExecutor.java
+++ b/src/tap/ADQLExecutor.java
@@ -49,7 +49,7 @@ import adql.translator.TranslationException;
  * 
  * 
  * @author Gr&eacute;gory Mantelet (CDS;ARI)
- * @version 2.0 (07/2014)
+ * @version 2.0 (08/2014)
  */
 public class ADQLExecutor {
 
@@ -121,7 +121,7 @@ public class ADQLExecutor {
 		long start = System.currentTimeMillis();
 		try{
 			// Get a "database" connection:
-			dbConn = service.getFactory().createDBConnection(report.jobID);
+			dbConn = service.getFactory().getConnection(report.jobID);
 
 			// 1. UPLOAD TABLES, if needed:
 			if (tapParams != null && tapParams.getTableLoaders() != null && tapParams.getTableLoaders().length > 0){
@@ -157,19 +157,18 @@ public class ADQLExecutor {
 			npe.printStackTrace();
 			throw npe;
 		}finally{
+			// Drop all the uploaded tables (they are not supposed to exist after the query execution):
 			try{
 				dropUploadedTables();
 			}catch(TAPException e){
 				logger.error("JOB " + report.jobID + "\tCan not drop uploaded tables !", e);
 			}
-			try{
-				if (dbConn != null){
-					dbConn.close();
-					dbConn = null;
-				}
-			}catch(TAPException e){
-				logger.error("JOB " + report.jobID + "\tCan not close the DB connection !", e);
+			// Free the connection (so that giving it back to a pool, if any, otherwise, just free resources):
+			if (dbConn != null){
+				service.getFactory().freeConnection(dbConn);
+				dbConn = null;
 			}
+			// Set the total duration in the report:
 			report.setTotalDuration(System.currentTimeMillis() - start);
 			logger.queryFinished(report);
 		}
diff --git a/src/tap/AbstractTAPFactory.java b/src/tap/AbstractTAPFactory.java
index 73de9b13352db805a443a2eaed37231fee103955..34e61ef322d4afeef489dd387076221cddd2db0e 100644
--- a/src/tap/AbstractTAPFactory.java
+++ b/src/tap/AbstractTAPFactory.java
@@ -16,66 +16,45 @@ package tap;
  * You should have received a copy of the GNU Lesser General Public License
  * along with TAPLibrary.  If not, see <http://www.gnu.org/licenses/>.
  * 
- * Copyright 2012 - UDS/Centre de Données astronomiques de Strasbourg (CDS)
+ * Copyright 2012,2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS),
+ *                       Astronomisches Rechen Institut (ARI)
  */
 
-import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 
 import tap.db.DBConnection;
-import tap.metadata.TAPMetadata;
-import tap.metadata.TAPSchema;
 import tap.metadata.TAPTable;
 import tap.parameters.TAPParameters;
 import tap.upload.Uploader;
 import uws.UWSException;
 import uws.job.ErrorSummary;
-import uws.job.JobThread;
 import uws.job.Result;
-import uws.job.UWSJob;
-import uws.job.parameters.UWSParameters;
 import uws.job.user.JobOwner;
-import uws.service.AbstractUWSFactory;
 import uws.service.UWSService;
 import uws.service.backup.UWSBackupManager;
 import adql.db.DBChecker;
-import adql.db.DBTable;
 import adql.parser.ADQLQueryFactory;
 import adql.parser.QueryChecker;
 
-public abstract class AbstractTAPFactory extends AbstractUWSFactory implements TAPFactory {
-
-	protected final ServiceConnection service;
+public abstract class AbstractTAPFactory extends TAPFactory {
 
 	protected AbstractTAPFactory(ServiceConnection service) throws NullPointerException{
-		if (service == null)
-			throw new NullPointerException("Can not create a TAPFactory without a ServiceConnection instance !");
-
-		this.service = service;
+		super(service);
 	}
 
 	@Override
-	public UWSService createUWS() throws TAPException, UWSException{
-		return new UWSService(this.service.getFactory(), this.service.getFileManager(), this.service.getLogger());
-	}
-
-	@Override
-	public UWSBackupManager createUWSBackupManager(final UWSService uws) throws TAPException, UWSException{
+	public UWSBackupManager createUWSBackupManager(final UWSService uws) throws TAPException{
 		return null;
 	}
 
 	@Override
-	public UWSJob createJob(HttpServletRequest request, JobOwner owner) throws UWSException{
-		if (!service.isAvailable())
-			throw new UWSException(HttpServletResponse.SC_SERVICE_UNAVAILABLE, service.getAvailability());
-
+	protected TAPJob createTAPJob(final HttpServletRequest request, final JobOwner owner) throws UWSException{
 		try{
-			TAPParameters tapParams = (TAPParameters)createUWSParameters(request);
+			TAPParameters tapParams = createTAPParameters(request);
 			return new TAPJob(owner, tapParams);
 		}catch(TAPException te){
 			throw new UWSException(UWSException.INTERNAL_SERVER_ERROR, te, "Can not create a TAP asynchronous job !");
@@ -83,38 +62,21 @@ public abstract class AbstractTAPFactory extends AbstractUWSFactory implements T
 	}
 
 	@Override
-	public UWSJob createJob(String jobId, JobOwner owner, final UWSParameters params, long quote, long startTime, long endTime, List<Result> results, ErrorSummary error) throws UWSException{
-		if (!service.isAvailable())
-			throw new UWSException(HttpServletResponse.SC_SERVICE_UNAVAILABLE, service.getAvailability());
+	protected TAPJob createTAPJob(final String jobId, final JobOwner owner, final TAPParameters params, final long quote, final long startTime, final long endTime, final List<Result> results, final ErrorSummary error) throws UWSException{
 		try{
-			return new TAPJob(jobId, owner, (TAPParameters)params, quote, startTime, endTime, results, error);
+			return new TAPJob(jobId, owner, params, quote, startTime, endTime, results, error);
 		}catch(TAPException te){
 			throw new UWSException(UWSException.INTERNAL_SERVER_ERROR, te, "Can not create a TAP asynchronous job !");
 		}
 	}
 
-	@Override
-	public final JobThread createJobThread(final UWSJob job) throws UWSException{
-		try{
-			return new AsyncThread((TAPJob)job, createADQLExecutor());
-		}catch(TAPException te){
-			throw new UWSException(UWSException.INTERNAL_SERVER_ERROR, te, "Impossible to create an AsyncThread !");
-		}
-	}
-
 	@Override
 	public ADQLExecutor createADQLExecutor() throws TAPException{
 		return new ADQLExecutor(service);
 	}
 
-	/**
-	 * Extracts the parameters from the given request (multipart or not).
-	 * This function is used only to set UWS parameters, not to create a TAP query (for that, see {@link TAPParameters}).
-	 * 
-	 * @see uws.service.AbstractUWSFactory#extractParameters(javax.servlet.http.HttpServletRequest, uws.service.UWS)
-	 */
 	@Override
-	public UWSParameters createUWSParameters(HttpServletRequest request) throws UWSException{
+	protected TAPParameters createTAPParameters(final HttpServletRequest request) throws UWSException{
 		try{
 			return new TAPParameters(request, service, getExpectedAdditionalParameters(), getInputParamControllers());
 		}catch(TAPException te){
@@ -123,7 +85,7 @@ public abstract class AbstractTAPFactory extends AbstractUWSFactory implements T
 	}
 
 	@Override
-	public UWSParameters createUWSParameters(Map<String,Object> params) throws UWSException{
+	protected TAPParameters createTAPParameters(final Map<String,Object> params) throws UWSException{
 		try{
 			return new TAPParameters(service, params, getExpectedAdditionalParameters(), getInputParamControllers());
 		}catch(TAPException te){
@@ -137,16 +99,7 @@ public abstract class AbstractTAPFactory extends AbstractUWSFactory implements T
 	}
 
 	@Override
-	public QueryChecker createQueryChecker(TAPSchema uploadSchema) throws TAPException{
-		TAPMetadata meta = service.getTAPMetadata();
-		ArrayList<DBTable> tables = new ArrayList<DBTable>(meta.getNbTables());
-		Iterator<TAPTable> it = meta.getTables();
-		while(it.hasNext())
-			tables.add(it.next());
-		if (uploadSchema != null){
-			for(TAPTable table : uploadSchema)
-				tables.add(table);
-		}
+	protected QueryChecker createQueryChecker(final Collection<TAPTable> tables) throws TAPException{
 		return new DBChecker(tables);
 	}
 
diff --git a/src/tap/ServiceConnection.java b/src/tap/ServiceConnection.java
index 6a2782b7f4ba6190f677d9afe681347ee48021b0..a270435c9c2b42973d600cc7baf99c9ddd7c0c8f 100644
--- a/src/tap/ServiceConnection.java
+++ b/src/tap/ServiceConnection.java
@@ -64,6 +64,8 @@ public interface ServiceConnection {
 
 	public Collection<String> getCoordinateSystems();
 
+	public int getNbMaxAsyncJobs();
+
 	public TAPLog getLogger();
 
 	public TAPFactory getFactory();
diff --git a/src/tap/TAPFactory.java b/src/tap/TAPFactory.java
index 9911edd183039112cf0f2d6eaf93102311a36f55..3ef5ef93b0d4ac2af9a1229aef8773285209a81f 100644
--- a/src/tap/TAPFactory.java
+++ b/src/tap/TAPFactory.java
@@ -16,36 +16,137 @@ package tap;
  * You should have received a copy of the GNU Lesser General Public License
  * along with TAPLibrary.  If not, see <http://www.gnu.org/licenses/>.
  * 
- * Copyright 2012 - UDS/Centre de Données astronomiques de Strasbourg (CDS)
+ * Copyright 2012,2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS),
+ *                       Astronomisches Rechen Institut (ARI)
  */
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 import tap.db.DBConnection;
+import tap.metadata.TAPMetadata;
 import tap.metadata.TAPSchema;
+import tap.metadata.TAPTable;
+import tap.parameters.TAPParameters;
 import tap.upload.Uploader;
 import uws.UWSException;
-import uws.service.UWSFactory;
+import uws.job.ErrorSummary;
+import uws.job.JobThread;
+import uws.job.Result;
+import uws.job.UWSJob;
+import uws.job.parameters.UWSParameters;
+import uws.job.user.JobOwner;
+import uws.service.AbstractUWSFactory;
 import uws.service.UWSService;
 import uws.service.backup.UWSBackupManager;
 import adql.parser.ADQLQueryFactory;
 import adql.parser.QueryChecker;
 import adql.translator.ADQLTranslator;
 
-public interface TAPFactory extends UWSFactory {
+public abstract class TAPFactory extends AbstractUWSFactory {
+
+	protected final ServiceConnection service;
+
+	protected TAPFactory(final ServiceConnection service) throws NullPointerException{
+		if (service == null)
+			throw new NullPointerException("Can not create a TAPFactory without a ServiceConnection instance !");
+
+		this.service = service;
+	}
+
+	public abstract ADQLTranslator createADQLTranslator() throws TAPException;
+
+	protected abstract DBConnection createDBConnection() throws TAPException;
+
+	public abstract DBConnection getConnection(final String jobID) throws TAPException;
+
+	public abstract void freeConnection(final DBConnection conn);
+
+	/**
+	 * @return	<=0 in case of problem, >0 otherwise.
+	 */
+	public abstract int countFreeConnections();
+
+	public UWSService createUWS() throws TAPException{
+		return new UWSService(this, this.service.getFileManager(), this.service.getLogger());
+	}
+
+	public abstract UWSBackupManager createUWSBackupManager(final UWSService uws) throws TAPException;
+
+	@Override
+	public final UWSJob createJob(HttpServletRequest request, JobOwner owner) throws UWSException{
+		if (!service.isAvailable())
+			throw new UWSException(HttpServletResponse.SC_SERVICE_UNAVAILABLE, service.getAvailability());
+
+		return createTAPJob(request, owner);
+	}
+
+	protected abstract TAPJob createTAPJob(final HttpServletRequest request, final JobOwner owner) throws UWSException;
+
+	@Override
+	public final UWSJob createJob(String jobId, JobOwner owner, final UWSParameters params, long quote, long startTime, long endTime, List<Result> results, ErrorSummary error) throws UWSException{
+		if (!service.isAvailable())
+			throw new UWSException(HttpServletResponse.SC_SERVICE_UNAVAILABLE, service.getAvailability());
+
+		return createTAPJob(jobId, owner, (TAPParameters)params, quote, startTime, endTime, results, error);
+	}
+
+	protected abstract TAPJob createTAPJob(final String jobId, final JobOwner owner, final TAPParameters params, final long quote, final long startTime, final long endTime, final List<Result> results, final ErrorSummary error) throws UWSException;
+
+	@Override
+	public final JobThread createJobThread(final UWSJob job) throws UWSException{
+		try{
+			return new AsyncThread((TAPJob)job, createADQLExecutor());
+		}catch(TAPException te){
+			throw new UWSException(UWSException.INTERNAL_SERVER_ERROR, te, "Impossible to create an AsyncThread !");
+		}
+	}
+
+	public abstract ADQLExecutor createADQLExecutor() throws TAPException;
 
-	public UWSService createUWS() throws TAPException, UWSException;
+	/**
+	 * Extracts the parameters from the given request (multipart or not).
+	 * This function is used only to set UWS parameters, not to create a TAP query (for that, see {@link TAPParameters}).
+	 * 
+	 * @see uws.service.AbstractUWSFactory#extractParameters(javax.servlet.http.HttpServletRequest, uws.service.UWS)
+	 */
+	@Override
+	public final UWSParameters createUWSParameters(HttpServletRequest request) throws UWSException{
+		return createTAPParameters(request);
+	}
 
-	public UWSBackupManager createUWSBackupManager(final UWSService uws) throws TAPException, UWSException;
+	protected abstract TAPParameters createTAPParameters(final HttpServletRequest request) throws UWSException;
 
-	public ADQLExecutor createADQLExecutor() throws TAPException;
+	@Override
+	public final UWSParameters createUWSParameters(Map<String,Object> params) throws UWSException{
+		return createTAPParameters(params);
+	}
 
-	public ADQLQueryFactory createQueryFactory() throws TAPException;
+	protected abstract TAPParameters createTAPParameters(final Map<String,Object> params) throws UWSException;
 
-	public QueryChecker createQueryChecker(TAPSchema uploadSchema) throws TAPException;
+	public abstract ADQLQueryFactory createQueryFactory() throws TAPException;
 
-	public ADQLTranslator createADQLTranslator() throws TAPException;
+	public final QueryChecker createQueryChecker(final TAPSchema uploadSchema) throws TAPException{
+		TAPMetadata meta = service.getTAPMetadata();
+		ArrayList<TAPTable> tables = new ArrayList<TAPTable>(meta.getNbTables());
+		Iterator<TAPTable> it = meta.getTables();
+		while(it.hasNext())
+			tables.add(it.next());
+		if (uploadSchema != null){
+			for(TAPTable table : uploadSchema)
+				tables.add(table);
+		}
+		return createQueryChecker(tables);
+	}
 
-	public DBConnection createDBConnection(final String jobID) throws TAPException;
+	protected abstract QueryChecker createQueryChecker(final Collection<TAPTable> tables) throws TAPException;
 
-	public Uploader createUploader(final DBConnection dbConn) throws TAPException;
+	public abstract Uploader createUploader(final DBConnection dbConn) throws TAPException;
 
 }
diff --git a/src/tap/formatter/JSONFormat.java b/src/tap/formatter/JSONFormat.java
index 1e87e5d17689fc0ee97138d49cf791724d4df1ca..5437854eb09438063763e5890ed21b52880cf6b8 100644
--- a/src/tap/formatter/JSONFormat.java
+++ b/src/tap/formatter/JSONFormat.java
@@ -222,7 +222,7 @@ public class JSONFormat implements OutputFormat {
 		out.object();
 
 		// "name": "..."
-		out.key("name").value(tapCol.getName());
+		out.key("name").value(tapCol.getADQLName());
 
 		// "description": "..." (if any)
 		if (tapCol.getDescription() != null && tapCol.getDescription().trim().length() > 0)
diff --git a/src/tap/resource/ASync.java b/src/tap/resource/ASync.java
index 38ba10cc2cb45fda3c76f05c31245cefd1a7b7bf..c23eb7253a19bb3e47b9707c449a864724476cf7 100644
--- a/src/tap/resource/ASync.java
+++ b/src/tap/resource/ASync.java
@@ -20,6 +20,7 @@ package tap.resource;
  */
 
 import java.io.IOException;
+
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
@@ -27,10 +28,15 @@ import javax.servlet.http.HttpServletResponse;
 
 import tap.ServiceConnection;
 import tap.TAPException;
+import tap.TAPFactory;
 import uws.UWSException;
 import uws.job.JobList;
+import uws.job.UWSJob;
+import uws.job.manager.AbstractQueuedExecutionManager;
+import uws.job.manager.QueuedExecutionManager;
 import uws.service.UWSService;
 import uws.service.backup.UWSBackupManager;
+import uws.service.log.UWSLog;
 
 public class ASync implements TAPResource {
 
@@ -39,6 +45,7 @@ public class ASync implements TAPResource {
 	@SuppressWarnings("unchecked")
 	protected final ServiceConnection service;
 	protected final UWSService uws;
+	protected final JobList jobList;
 
 	@SuppressWarnings("unchecked")
 	public ASync(ServiceConnection service) throws UWSException, TAPException{
@@ -49,8 +56,13 @@ public class ASync implements TAPResource {
 		if (uws.getUserIdentifier() == null)
 			uws.setUserIdentifier(service.getUserIdentifier());
 
-		if (uws.getJobList(getName()) == null)
-			uws.addJobList(new JobList(getName()));
+		if (uws.getJobList(getName()) == null){
+			jobList = new JobList(getName());
+			uws.addJobList(jobList);
+			if (service.getNbMaxAsyncJobs() > 0)
+				jobList.setExecutionManager(new AsyncExecutionManager(service.getFactory(), service.getLogger(), service.getNbMaxAsyncJobs()));
+		}else
+			jobList = uws.getJobList(getName());
 
 		if (uws.getBackupManager() == null)
 			uws.setBackupManager(service.getFactory().createUWSBackupManager(uws));
@@ -77,6 +89,16 @@ public class ASync implements TAPResource {
 		}
 	}
 
+	public void freeConnectionAvailable(){
+		if (jobList.getExecutionManager() != null){
+			try{
+				jobList.getExecutionManager().refresh();
+			}catch(UWSException e){
+				service.getLogger().warning("Can not refresh the ASYNC queue! (CAUSE: " + e.getMessage() + ")");
+			}
+		}
+	}
+
 	@Override
 	public String getName(){
 		return RESOURCE_NAME;
@@ -106,4 +128,27 @@ public class ASync implements TAPResource {
 		return uws.executeRequest(request, response);
 	}
 
+	private class AsyncExecutionManager extends AbstractQueuedExecutionManager {
+
+		private final TAPFactory factory;
+
+		/** The maximum number of running jobs. */
+		protected int nbMaxRunningJobs = QueuedExecutionManager.NO_QUEUE;
+
+		public AsyncExecutionManager(final TAPFactory factory, UWSLog logger, int maxRunningJobs){
+			super(logger);
+			this.factory = factory;
+			nbMaxRunningJobs = (maxRunningJobs <= 0) ? QueuedExecutionManager.NO_QUEUE : maxRunningJobs;
+		}
+
+		@Override
+		public boolean isReadyForExecution(UWSJob jobToExecute){
+			if (!hasQueue())
+				return factory.countFreeConnections() >= 1;
+			else
+				return (runningJobs.size() < nbMaxRunningJobs) && (factory.countFreeConnections() >= 1);
+		}
+
+	}
+
 }
diff --git a/src/tap/resource/Sync.java b/src/tap/resource/Sync.java
index 43825dc1be79ef22dd6116cc7e91b22c729dc621..c3cf02232a25714a73a7163510df53351c9328db 100644
--- a/src/tap/resource/Sync.java
+++ b/src/tap/resource/Sync.java
@@ -76,15 +76,26 @@ public class Sync implements TAPResource {
 		if (params.getRequest().equalsIgnoreCase(TAPJob.REQUEST_GET_CAPABILITIES))
 			return capabilities.executeResource(request, response);
 
+		// Ensure the service is currently available:
 		if (!service.isAvailable()){
 			response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, service.getAvailability());
 			return false;
 		}
 
-		TAPSyncJob syncJob = new TAPSyncJob(service, params);
-		syncJob.start(response);
+		/* Ensure that at least 1 DB connection is available for asynchronous queries.
+		 * If yes, just execute synchronously the given job:
+		 */
+		if (service.getFactory().countFreeConnections() > 1){
+			TAPSyncJob syncJob = new TAPSyncJob(service, params);
+			syncJob.start(response);
+			return true;
+		}
+		// Otherwise, send an error:
+		else{
+			response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, "TAP service too busy! No connection available for the moment. You should try later or create an asynchronous query (which will be executed when enough resources will be available again).");
+			return false;
+		}
 
-		return true;
 	}
 
 }
diff --git a/src/tap/resource/TAP.java b/src/tap/resource/TAP.java
index db12b135546bdb6d21b5a649d805bb4e62a16127..acb2d98ef4a0cab141aa913971a4fac03c4da551 100644
--- a/src/tap/resource/TAP.java
+++ b/src/tap/resource/TAP.java
@@ -17,7 +17,7 @@ package tap.resource;
  * along with TAPLibrary.  If not, see <http://www.gnu.org/licenses/>.
  * 
  * Copyright 2012,2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS),
- *                       Astronomisches Rechen Institute (ARI)
+ *                       Astronomisches Rechen Institut (ARI)
  */
 
 import java.io.BufferedInputStream;
@@ -91,7 +91,7 @@ public class TAP implements VOSIResource {
 		if (service.uploadEnabled()){
 			DBConnection dbConn = null;
 			try{
-				dbConn = service.getFactory().createDBConnection("TAP(ServiceConnection)");
+				dbConn = service.getFactory().getConnection("TAP(ServiceConnection)");
 				// TODO CLEAN ACTION: DROP SCHEMA!
 				/*dbConn.dropSchema("TAP_UPLOAD");
 				dbConn.createSchema("TAP_UPLOAD");*/
@@ -99,7 +99,7 @@ public class TAP implements VOSIResource {
 				throw new UWSException(UWSException.INTERNAL_SERVER_ERROR, e, "Error while creating the schema TAP_UPLOAD !");
 			}finally{
 				if (dbConn != null)
-					dbConn.close();
+					service.getFactory().freeConnection(dbConn);
 			}
 		}
 
@@ -259,7 +259,7 @@ public class TAP implements VOSIResource {
 	}
 
 	public final UWSService getUWS(){
-		TAPResource res = resources.get("async");
+		TAPResource res = getASync();
 		if (res != null)
 			return ((ASync)res).getUWS();
 		else
@@ -331,6 +331,10 @@ public class TAP implements VOSIResource {
 			writeError(te, response);
 		}catch(Throwable t){
 			errorWriter.writeError(t, response, request, owner, (resourceName == null) ? "Writing the TAP home page" : ("Executing the TAP resource " + resourceName));
+		}finally{
+			// Notify the queue of the asynchronous jobs that a new connection is available:
+			if (resourceName.equalsIgnoreCase(Sync.RESOURCE_NAME) && service.getFactory().countFreeConnections() >= 1)
+				getASync().freeConnectionAvailable();
 		}
 	}
 
diff --git a/test/tap/formatter/JSONFormatTest.java b/test/tap/formatter/JSONFormatTest.java
index 4eb9449a5762c093024980817af1085c5da09f07..8fa644f0bbbc602857d6134921b72b7525fa17a7 100644
--- a/test/tap/formatter/JSONFormatTest.java
+++ b/test/tap/formatter/JSONFormatTest.java
@@ -249,6 +249,11 @@ public class JSONFormatTest {
 			return null;
 		}
 
+		@Override
+		public int getNbMaxAsyncJobs(){
+			return -1;
+		}
+
 	}
 
 }
diff --git a/test/tap/formatter/SVFormatTest.java b/test/tap/formatter/SVFormatTest.java
index 29d34a30d58c473c8eed27ce760c78720d2b4fff..eea52ccf62362d8becbb0bf486c6d864d821ea1a 100644
--- a/test/tap/formatter/SVFormatTest.java
+++ b/test/tap/formatter/SVFormatTest.java
@@ -269,6 +269,11 @@ public class SVFormatTest {
 			return null;
 		}
 
+		@Override
+		public int getNbMaxAsyncJobs(){
+			return -1;
+		}
+
 	}
 
 }
diff --git a/test/tap/formatter/TextFormatTest.java b/test/tap/formatter/TextFormatTest.java
index ca6631d9ba1792ba5af2b181bcf43353ea7f58d4..6715bb399661fe9d935c249be79ca67398f24d77 100644
--- a/test/tap/formatter/TextFormatTest.java
+++ b/test/tap/formatter/TextFormatTest.java
@@ -269,6 +269,11 @@ public class TextFormatTest {
 			return null;
 		}
 
+		@Override
+		public int getNbMaxAsyncJobs(){
+			return -1;
+		}
+
 	}
 
 }
diff --git a/test/tap/formatter/VOTableFormatTest.java b/test/tap/formatter/VOTableFormatTest.java
index d54c80d28a19453f189b9d658c450e5963f15d7c..5a07973d8426a9ad04ec37449c064e32e492936a 100644
--- a/test/tap/formatter/VOTableFormatTest.java
+++ b/test/tap/formatter/VOTableFormatTest.java
@@ -278,6 +278,11 @@ public class VOTableFormatTest {
 			return null;
 		}
 
+		@Override
+		public int getNbMaxAsyncJobs(){
+			return -1;
+		}
+
 	}
 
 }