        TRI_SetErrorContextAql(context, TRI_ERROR_OUT_OF_MEMORY, NULL);
        break;
      }
+diff --git a/arangod/RestHandler/RestDocumentHandler.cpp b/arangod/RestHandler/RestDocumentHandler.cpp
+index e8fb467..21c5851 100644
+--- a/arangod/RestHandler/RestDocumentHandler.cpp
++++ b/arangod/RestHandler/RestDocumentHandler.cpp
+@@ -270,7 +270,8 @@ bool RestDocumentHandler::createDocument () {
+   // inside write transaction
+   // .............................................................................
+ 
+-  _documentCollection->beginWrite(_documentCollection);
++  int lockResult = _documentCollection->beginWrite(_documentCollection);
++  LOGGER_TRACE << "result of beginWrite: " << lockResult;
+ 
+   bool waitForSync = _documentCollection->base._waitForSync;
+   TRI_voc_cid_t cid = _documentCollection->base._cid;
+@@ -415,12 +416,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 +514,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 +542,7 @@ bool RestDocumentHandler::readAllDocuments () {
+   }
+   
+   _documentCollection->endRead(_documentCollection);
++  LOGGER_TRACE << "endRead";
+ 
+   // .............................................................................
+   // outside read transaction
+@@ -715,7 +720,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 +866,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..c65fa15 100644
 --- a/arangod/V8Server/ApplicationV8.cpp

 
   if (tryCatch.HasCaught()) {
     if (tryCatch.Exception()->IsObject() && v8::Handle<v8::Array>::Cast(tryCatch.Exception())->HasOwnProperty(v8::String::New("errorNum"))) {
@@ -1834,8 +1917,8 @@ static v8::Handle<v8::Value> JS_ExplainAhuacatl (v8::Arguments const& argv) {
   // bind parameters
   triagens::rest::JsonContainer parameters(TRI_UNKNOWN_MEM_ZONE, argc > 1 ? TRI_JsonObject(argv[1]) : 0);
 

 /// @brief get a (persistent) cursor by its id
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -1707,7 +1804,7 @@ static v8::Handle<v8::Value> JS_Cursor (v8::Arguments const& argv) {
                          TRI_CreateErrorObject(TRI_ERROR_CURSOR_NOT_FOUND,
                                                "disposed or unknown cursor")));
   }
