Index: tmp/org.txm.core/src/java/org/txm/objects/CorpusBuild.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/CorpusBuild.java	(revision 1546)
+++ tmp/org.txm.core/src/java/org/txm/objects/CorpusBuild.java	(revision 1547)
@@ -869,7 +869,7 @@
 		this.userName = name;
 	}
 	
-	public void setID(String id) {
+	protected void setID(String id) {
 		this.pID = id;
 	}
 }
\ No newline at end of file
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java	(revision 1546)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java	(revision 1547)
@@ -39,6 +39,7 @@
 import java.util.UUID;
 
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osgi.util.NLS;
 import org.txm.Toolbox;
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.core.results.TXMParameters;
@@ -80,7 +81,7 @@
 	public MainCorpus(Project project) throws InvalidCqpIdException, CqiClientException {
 		super(project);
 		this.internalPersistable = true;
-		
+
 		this.dataDirectory = new File(getProjectDirectory(), "data/"+getID());
 		this.registryFile = new File(getProjectDirectory(), "registry/"+getID().toLowerCase());
 	}
@@ -110,9 +111,9 @@
 	 */
 	public MainCorpus(String parametersNodePath) throws InvalidCqpIdException, CqiClientException {
 		super(parametersNodePath);
-		
+
 		this.internalPersistable = true;
-		
+
 		this.dataDirectory = new File(getProjectDirectory(), "data/"+getID());
 		this.registryFile = new File(getProjectDirectory(), "registry/"+getID().toLowerCase());
 	}
@@ -194,7 +195,7 @@
 	@Override
 	public int getSize() throws CqiClientException {
 		if (!hasBeenComputedOnce) return 0;
-		
+
 		if (this.size == -1) {
 			try {
 				this.size = CorpusManager.getCorpusManager().getCqiClient()
@@ -448,7 +449,7 @@
 		}
 		return textids;
 	}
-	
+
 	/**
 	 * 
 	 * @return the text_id values of the CQP corpus ordered by position
@@ -457,7 +458,7 @@
 	 * @throws CqiServerError
 	 */
 	public String[] getCorpusTextIdsList() throws CqiClientException, IOException, CqiServerError {
-		
+
 		int nbtext = getNbTexts();
 		int[] structs = new int[nbtext];
 		for(int i = 0 ; i < nbtext ; i++)
@@ -465,7 +466,7 @@
 
 		StructuralUnit text_su = this.getStructuralUnit("text"); //$NON-NLS-1$
 		StructuralUnitProperty text_id_sup = text_su.getProperty("id"); //$NON-NLS-1$
-		
+
 		return CorpusManager.getCorpusManager().getCqiClient().struc2Str(text_id_sup.getQualifiedName(), structs);
 	}
 
@@ -566,6 +567,10 @@
 	}
 
 	protected boolean modified = false;
+	/**
+	 * list of loaded/computed corpus
+	 */
+	private static HashMap<String, MainCorpus> corpora = new HashMap<String, MainCorpus>();
 	public boolean isModified() { return modified; }
 	public void setIsModified(boolean b) { modified = b; }
 
@@ -583,7 +588,11 @@
 	@Override
 	public void clean() {
 		super.clean();
-		
+
+		if (corpora.get(this.pID) == this) { // un register the MainCorpus
+			corpora.remove(this.pID);
+		}
+
 		try {
 			if (CQPSearchEngine.isInitialized()) {
 				CQPSearchEngine.getCqiClient().dropCorpus(getID());
@@ -594,7 +603,7 @@
 
 		DeleteDir.deleteDirectory(dataDirectory);
 		registryFile.delete();
-		
+
 		Toolbox.notifyEngines(this, "clean");
 	}
 
@@ -630,6 +639,22 @@
 
 	@Override
 	protected boolean _compute() throws Exception {
+		if (corpora.get(this.pID) != null && corpora.get(this.pID) != this) {
+			System.out.println(NLS.bind("Warning: duplicated \"{0}\" CQP corpus in \"{1}\"", this.pID, this.getProjectDirectory()));
+			return false;
+		}
+
+		if (CQPSearchEngine.isInitialized()) {
+			try {
+				CQPSearchEngine.getCqiClient().corpusCharset(this.pID);
+				corpora.put(this.pID, this); // register the corpus
+			} catch(Exception e) {
+				if (corpora.get(this.pID) == this) {
+					corpora.remove(this.pID); // unregister the broken corpus
+				}
+				return false;
+			}
+		}
 		return true;
 	}
 
@@ -638,7 +663,7 @@
 		return "Corpus";
 	}
 
-	public void setID(String id) {
+	protected void setID(String id) {
 		this.pID = id;
 	}
 }
\ No newline at end of file
