      v8::Handle<v8::Object> errorObject = TRI_CreateErrorObject(TRI_ERROR_OUT_OF_MEMORY, "out of memory");
  
      return scope.Close(v8::ThrowException(errorObject));
-@@ -1091,6 +1172,7 @@ static v8::Handle<v8::Value> ExecuteQueryCursorAhuacatl (TRI_vocbase_t* const vo
+@@ -1091,6 +1178,7 @@ static v8::Handle<v8::Value> ExecuteQueryCursorAhuacatl (TRI_vocbase_t* const vo
    assert(cursor);
    TRI_StoreShadowData(vocbase->_cursors, (const void* const) cursor);
  

 
   // generate result
   if (mptr._did != 0) {
@@ -415,12 +419,14 @@ bool RestDocumentHandler::readSingleDocument (bool generateBody) {
   // inside read transaction
   // .............................................................................
 
-  _documentCollection->beginRead(_documentCollection);
+  int lockResult = _documentCollection->beginRead(_documentCollection);
+  LOGGER_TRACE << "result of beginRead: " << lockResult;
 
   TRI_voc_cid_t cid = _documentCollection->base._cid;
   TRI_doc_mptr_t const document = findDocument(did);
 
   _documentCollection->endRead(_documentCollection);
+  LOGGER_TRACE << "endRead";
 
   // .............................................................................
   // outside read transaction
@@ -511,7 +517,8 @@ bool RestDocumentHandler::readAllDocuments () {
 
   vector<TRI_voc_did_t> ids;
 
-  _documentCollection->beginRead(_documentCollection);
+  int lockResult = _documentCollection->beginRead(_documentCollection);
+  LOGGER_TRACE << "result of beginRead: " << lockResult;
 
   TRI_voc_cid_t cid = _documentCollection->base._cid;
 
@@ -538,6 +545,7 @@ bool RestDocumentHandler::readAllDocuments () {
   }
   
   _documentCollection->endRead(_documentCollection);
+  LOGGER_TRACE << "endRead";
 
   // .............................................................................
   // outside read transaction
@@ -715,7 +723,8 @@ bool RestDocumentHandler::updateDocument () {
   // inside write transaction
   // .............................................................................
 
-  _documentCollection->beginWrite(_documentCollection);
+  int lockResult = _documentCollection->beginWrite(_documentCollection);
+  LOGGER_TRACE << "result of beginWrite: " << lockResult;
 
   // unlocking is performed in updateJson()
   TRI_voc_rid_t rid = 0;
@@ -860,7 +869,8 @@ bool RestDocumentHandler::deleteDocument () {
   // inside write transaction
   // .............................................................................
 
-  _documentCollection->beginWrite(_documentCollection);
+  int lockResult = _documentCollection->beginWrite(_documentCollection);
+  LOGGER_TRACE << "result of beginWrite: " << lockResult;
 
   TRI_voc_rid_t rid = 0;
   TRI_voc_cid_t cid = _documentCollection->base._cid;
diff --git a/arangod/V8Server/ApplicationV8.cpp b/arangod/V8Server/ApplicationV8.cpp
index d200d55..80185d3 100644
--- a/arangod/V8Server/ApplicationV8.cpp

     return scope.Close(result);
   }
 
@@ -1063,6 +1147,7 @@ static v8::Handle<v8::Value> ExecuteQueryCursorAhuacatl (TRI_vocbase_t* const vo
   TRI_json_t* json = TRI_JsonObject(result);
 
   if (!json) {
