summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaspar De Groot2011-04-04 04:57:16 (EDT)
committerCaspar De Groot2011-04-04 04:57:16 (EDT)
commitcd3e3f4641eac18c87c7e63ef45ecb1a62accb5a (patch)
tree93a21a402658b4f5c0928fbec2abae5c78893f0c
parenta9771b2952e4ee1ece0f855fc1add8ca4a316698 (diff)
downloadcdo-cd3e3f4641eac18c87c7e63ef45ecb1a62accb5a.zip
cdo-cd3e3f4641eac18c87c7e63ef45ecb1a62accb5a.tar.gz
cdo-cd3e3f4641eac18c87c7e63ef45ecb1a62accb5a.tar.bz2
[Bug 338692] [DB][Derby] Interrupting connection thread brings embedded DB in broken state
https://bugs.eclipse.org/bugs/show_bug.cgi?id=338692
-rw-r--r--features/org.eclipse.emf.cdo.server.product-feature/rootfiles/configuration/cdo-server.xml1
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/QueryManager.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java5
3 files changed, 16 insertions, 1 deletions
diff --git a/features/org.eclipse.emf.cdo.server.product-feature/rootfiles/configuration/cdo-server.xml b/features/org.eclipse.emf.cdo.server.product-feature/rootfiles/configuration/cdo-server.xml
index 59ae314..cd41f86 100644
--- a/features/org.eclipse.emf.cdo.server.product-feature/rootfiles/configuration/cdo-server.xml
+++ b/features/org.eclipse.emf.cdo.server.product-feature/rootfiles/configuration/cdo-server.xml
@@ -17,6 +17,7 @@
<property name="supportingBranches" value="true"/>
<property name="supportingEcore" value="true"/>
<property name="ensureReferentialIntegrity" value="false"/>
+ <property name="allowInterruptRunningQueries" value="true"/>
<!--
<userManager type="file" description="_database/repo1.users"/>
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/QueryManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/QueryManager.java
index 6375e3f..963092d 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/QueryManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/QueryManager.java
@@ -17,6 +17,7 @@ import org.eclipse.emf.cdo.common.util.CDOQueryInfo;
import org.eclipse.emf.cdo.internal.server.bundle.OM;
import org.eclipse.emf.cdo.server.IQueryContext;
import org.eclipse.emf.cdo.server.IQueryHandler;
+import org.eclipse.emf.cdo.server.IRepository;
import org.eclipse.emf.cdo.server.IView;
import org.eclipse.emf.cdo.server.StoreThreadLocal;
import org.eclipse.emf.cdo.spi.common.branch.CDOBranchUtil;
@@ -57,6 +58,8 @@ public class QueryManager extends Lifecycle implements InternalQueryManager
private int nextQuery;
+ private boolean allowInterruptRunningQueries = true;
+
public QueryManager()
{
}
@@ -69,6 +72,12 @@ public class QueryManager extends Lifecycle implements InternalQueryManager
public void setRepository(InternalRepository repository)
{
this.repository = repository;
+
+ String value = repository.getProperties().get(IRepository.Props.ALLOW_INTERRUPT_RUNNING_QUERIES);
+ if (value != null)
+ {
+ allowInterruptRunningQueries = Boolean.parseBoolean(value);
+ }
}
public synchronized ExecutorService getExecutors()
@@ -245,7 +254,7 @@ public class QueryManager extends Lifecycle implements InternalQueryManager
cancelled = true;
if (future != null)
{
- future.cancel(true);
+ future.cancel(allowInterruptRunningQueries);
}
if (!started)
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java
index 98bdfb2..63cf6f5 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java
@@ -220,5 +220,10 @@ public interface IRepository extends CDOCommonRepository, IQueryHandlerProvider,
* @since 3.0
*/
public static final String ENSURE_REFERENTIAL_INTEGRITY = "ensureReferentialIntegrity"; //$NON-NLS-1$
+
+ /**
+ * @since 4.0
+ */
+ public static final String ALLOW_INTERRUPT_RUNNING_QUERIES = "allowInterruptRunningQueries"; //$NON-NLS-1$
}
}