public Object command(ActionRequest request) throws ResourceException {
  ODatabaseDocumentTx db=getConnection();
  try {
    return commands.query(request.getResourcePath(),request,db);
  }
  finally {
    if (db != null) {
      db.close();
    }
  }
}

public Object command ( ActionRequest request ) throws ResourceException { ODatabaseDocumentTx db = getConnection ( ) ; try { return commands . query ( request . getResourcePath ( ) , request , db ) ; } finally { if ( db != null ) { db . close ( ) ; } } }
execute a database command according to the details in the action request .
