Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon McDuff2008-06-12 13:57:14 +0000
committerSimon McDuff2008-06-12 13:57:14 +0000
commit3c32481914fc241a9a4105917c8569054a49c70c (patch)
tree1c4f3fd191176a969dd2379b047a40de99dd4d29
parentcb1d3c47862269c0d6604dea29a29e5c5ed9a3a3 (diff)
downloadcdo-3c32481914fc241a9a4105917c8569054a49c70c.tar.gz
cdo-3c32481914fc241a9a4105917c8569054a49c70c.tar.xz
cdo-3c32481914fc241a9a4105917c8569054a49c70c.zip
233273: [QUERY] Develop Query mechanism
https://bugs.eclipse.org/bugs/show_bug.cgi?id=233273
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/QueryManager.java18
1 files changed, 10 insertions, 8 deletions
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 d4cb15d494..ebc18999b3 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
@@ -88,7 +88,7 @@ public class QueryManager
{
if (listener == null)
{
- final IView view = (IView) getQueryResult().getView();
+ final IView view = (IView)getQueryResult().getView();
listener = new IListener()
{
@@ -105,7 +105,7 @@ public class QueryManager
}
}
};
-
+
// Add listener to the session
view.getSession().addListener(listener);
}
@@ -113,13 +113,14 @@ public class QueryManager
public void run()
{
-
- CloseableIterator<Object> itrResult = reader.createQueryIterator(queryResult.getQueryParameter());
-
ResultWriterQueue<Object> resultQueue = queryResult.getResultWriterQueue();
+
+ CloseableIterator<Object> itrResult = null;
try
{
+ itrResult = reader.createQueryIterator(queryResult.getQueryParameter());
+
while (itrResult.hasNext())
{
resultQueue.add(itrResult.next());
@@ -137,10 +138,11 @@ public class QueryManager
{
resultQueue.release();
- itrResult.close();
-
+ if (itrResult != null)
+ itrResult.close();
+
unregisterQueryNative(this);
-
+
}
}

Back to the top