  
            TRI_RemoveKeyAssociativePointer(&store->_ids, &shadow->_id);
            TRI_RemoveKeyAssociativePointer(&store->_pointers, shadow->_data);
+diff --git a/html/admin/js/modules/simple-query-basics.js b/html/admin/js/modules/simple-query-basics.js
+index fcbe6f4..5f6b0ca 100644
+--- a/html/admin/js/modules/simple-query-basics.js
++++ b/html/admin/js/modules/simple-query-basics.js
+@@ -151,6 +151,7 @@ GeneralArrayCursor.prototype._PRINT = function () {
+ ////////////////////////////////////////////////////////////////////////////////
+ 
+ GeneralArrayCursor.prototype.hasNext = function () {
++  require("console").log("hasNext called. current: " + this._current + ", stop: " + this._stop);
+   return this._current < this._stop;
+ }
+ 
+@@ -177,7 +178,8 @@ GeneralArrayCursor.prototype.dispose = function() {
+   this._limit = null;
+   this._countTotal = null;
+   this._countQuery = null;
+-  this.current = null;
++  this._current = null;
++  this._stop = null;
+ }
+ 
+ ////////////////////////////////////////////////////////////////////////////////
+@@ -664,7 +666,9 @@ SimpleQueryArray.prototype.execute = function () {
+       this._skip = 0;
+     }
+ 
++    require("console").log("creating GeneralArrayCursor with " + this._documents.length + " docs, skip: " + this._skip + ", limit: " + this._limit);
+     this._execution = new GeneralArrayCursor(this._documents, this._skip, this._limit);
++    require("console").log("created GeneralArrayCursor");
+   }
+ }
+ 
 diff --git a/js/actions/system/api-cursor.js b/js/actions/system/api-cursor.js
 index c2d1107..6b1ec42 100644
 --- a/js/actions/system/api-cursor.js

diff --git a/arangod/Ahuacatl/ahuacatl-codegen.c b/arangod/Ahuacatl/ahuacatl-codegen.c
index 737ea0f..29ebec7 100644
--- a/arangod/Ahuacatl/ahuacatl-codegen.c
+++ b/arangod/Ahuacatl/ahuacatl-codegen.c
@@ -2253,9 +2253,12 @@ char* TRI_GenerateCodeAql (TRI_aql_context_t* const context) {

 /// @brief V8 startup loader
 ////////////////////////////////////////////////////////////////////////////////
 
diff --git a/arangod/V8Server/v8-query.cpp b/arangod/V8Server/v8-query.cpp
index 0ca033a..e737007 100755
--- a/arangod/V8Server/v8-query.cpp
+++ b/arangod/V8Server/v8-query.cpp
@@ -35,6 +35,7 @@
 #include "V8/v8-conv.h"
 #include "V8/v8-utils.h"
 #include "V8Server/v8-vocbase.h"
+#include "Logger/Logger.h"
 
 // -----------------------------------------------------------------------------
 // --SECTION--                                                  HELPER FUNCTIONS
@@ -1210,6 +1211,7 @@ static v8::Handle<v8::Value> EdgesQuery (TRI_edge_direction_e direction, v8::Arg
 static v8::Handle<v8::Value> JS_AllQuery (v8::Arguments const& argv) {
   v8::HandleScope scope;
 
+  LOGGER_TRACE << "executing ALL query";
   // extract and use the simple collection
   v8::Handle<v8::Object> err;
   TRI_vocbase_col_t const* collection;
@@ -1243,10 +1245,15 @@ static v8::Handle<v8::Value> JS_AllQuery (v8::Arguments const& argv) {
   // inside a read transaction
   // .............................................................................
 
-  collection->_collection->beginRead(collection->_collection);
+  LOGGER_TRACE << "acquiring lock in allquery";
+  int lockResult = collection->_collection->beginRead(collection->_collection);
+  LOGGER_TRACE << "result of beginRead: " << lockResult;
 
   size_t total = sim->_primaryIndex._nrUsed;
   uint32_t count = 0;
+  LOGGER_TRACE << "number of documents: " << total;
+  LOGGER_TRACE << "skip: " << skip;
+  LOGGER_TRACE << "limit: " << limit;
 
   if (0 < total && 0 < limit) {
     TRI_barrier_t* barrier = 0;
@@ -1254,6 +1261,9 @@ static v8::Handle<v8::Value> JS_AllQuery (v8::Arguments const& argv) {
     void** beg = sim->_primaryIndex._table;
     void** end = sim->_primaryIndex._table + sim->_primaryIndex._nrAlloc;
     void** ptr = beg;
+    LOGGER_TRACE << "nrAlloc: " << sim->_primaryIndex._nrAlloc;
+    LOGGER_TRACE << "begin: " << beg;
+    LOGGER_TRACE << "end: " << beg;
 
     // skip from the beginning
     if (0 < skip) {
@@ -1291,6 +1301,7 @@ static v8::Handle<v8::Value> JS_AllQuery (v8::Arguments const& argv) {
       }
     }
 
+    LOGGER_TRACE << "beginning extraction. ptr: " << ptr << ", end: " << end << ", range: " << (end - ptr) << ", count: " << count << ", limit: " << limit;
     // limit
     for (;  ptr < end && count < limit;  ++ptr) {
       if (*ptr) {
@@ -1307,9 +1318,11 @@ static v8::Handle<v8::Value> JS_AllQuery (v8::Arguments const& argv) {
         }
       }
     }
+    LOGGER_TRACE << "finished extraction. count is " << count;
   }
 
   collection->_collection->endRead(collection->_collection);
+  LOGGER_TRACE << "endRead";
 
   // .............................................................................
   // outside a write transaction
diff --git a/arangod/V8Server/v8-vocbase.cpp b/arangod/V8Server/v8-vocbase.cpp
index 9bd6923..8b7aad7 100755
--- a/arangod/V8Server/v8-vocbase.cpp
