Remote query not working
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 25 Oct 2012 10:11:22 +0000 (10:11 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 25 Oct 2012 10:11:22 +0000 (10:11 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@5646 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/views/DistributionsView.java

index 7338afda00d8911ef017e4ab9d84036bea5c6a45..29a1ca9c57b988b20c448e24405d7cdeee1d1969 100644 (file)
@@ -473,8 +473,6 @@ public class DistributionsView extends ViewPart implements SlcNames, ArgeoNames
        /** Listens to drag */
        class ViewDragListener extends DragSourceAdapter {
                public void dragSetData(DragSourceEvent event) {
-                       if (log.isDebugEnabled())
-                               log.debug("Drag started: " + event);
                        IStructuredSelection selection = (IStructuredSelection) viewer
                                        .getSelection();
                        if (selection.getFirstElement() instanceof DistributionElem) {
@@ -592,12 +590,14 @@ public class DistributionsView extends ViewPart implements SlcNames, ArgeoNames
                        long begin = System.currentTimeMillis();
                        try {
                                // Not implemented in Davex Jackrabbit v2.2
-                               // Long fileCount = sourceSession
+                               // Query countQuery = sourceSession
                                // .getWorkspace()
                                // .getQueryManager()
                                // .createQuery("select count(*) from [nt:file]",
-                               // Query.JCR_SQL2).execute().getRows().nextRow()
-                               // .getValues()[0].getLong();
+                               // Query.JCR_SQL2);
+                               // QueryResult result = countQuery.execute();
+                               // Long fileCount = result.getRows().nextRow().getValues()[0]
+                               // .getLong();
 
                                ArgeoMonitor monitor = new EclipseArgeoMonitor(eclipseMonitor);
                                eclipseMonitor.beginTask("Copy files", ArgeoMonitor.UNKNOWN);
@@ -616,6 +616,9 @@ public class DistributionsView extends ViewPart implements SlcNames, ArgeoNames
                        } catch (RepositoryException e) {
                                return new Status(IStatus.ERROR, DistPlugin.ID, "Cannot merge",
                                                e);
+                       } finally {
+                               JcrUtils.logoutQuietly(sourceSession);
+                               JcrUtils.logoutQuietly(targetSession);
                        }
                }
        }