  }
  
 diff --git a/arangod/RestHandler/RestDocumentHandler.cpp b/arangod/RestHandler/RestDocumentHandler.cpp
-index e8fb467..b860cf3 100644
+index e8fb467..026654d 100644
 --- a/arangod/RestHandler/RestDocumentHandler.cpp
 +++ b/arangod/RestHandler/RestDocumentHandler.cpp
-@@ -270,13 +270,16 @@ bool RestDocumentHandler::createDocument () {
+@@ -270,13 +270,18 @@ bool RestDocumentHandler::createDocument () {
    // inside write transaction
    // .............................................................................
  
 -  _documentCollection->beginWrite(_documentCollection);
++  LOG_TRACE("before beginWrite");
 +  int lockResult = _documentCollection->beginWrite(_documentCollection);
++  LOG_TRACE("after beginWrite");
 +  LOGGER_TRACE << "result of beginWrite: " << lockResult;
  
    bool waitForSync = _documentCollection->base._waitForSync;

   // 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;

 
     return scope.Close(v8::ThrowException(errorObject));
   }
@@ -1927,11 +2039,10 @@ static v8::Handle<v8::Value> JS_ParseAhuacatl (v8::Arguments const& argv) {
   result->Set(v8::String::New("parsed"), v8::True());
 
   // return the bind parameter names
