Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Test Roxy deployment with MarkLogic 9 #596

Closed
dmcassel opened this issue Apr 6, 2016 · 4 comments
Closed

Test Roxy deployment with MarkLogic 9 #596

dmcassel opened this issue Apr 6, 2016 · 4 comments

Comments

@dmcassel
Copy link
Collaborator

dmcassel commented Apr 6, 2016

MarkLogic 9 Early Access 1 release is out (limited availability). Test and fix as needed.

@dmcassel dmcassel added this to the 1.7.4 milestone Apr 6, 2016
@grtjn
Copy link
Contributor

grtjn commented Apr 6, 2016

There seems to be (yet another) small change in QC evaler. Apparently, it now requires both dbid and sid. I changed execute_query_7 in deploy/lib/server_config.rb as follows, and that seems to run against ML9. Not entirely convinced it is backwards-compatible:

def execute_query_7(query, properties = {})
  # We need a context for this query. Here's what we look for, in order of preference:
  # 1. A caller-specified database
  # 2. A caller-specified application server
  # 3. An application server that is present by default
  # 4. Any database
  if properties[:db_name] != nil
    db_id = get_db_id(properties[:db_name])
+   sid = get_sid("Manage")
  elsif properties[:app_name] != nil
    sid = get_sid(properties[:app_name])
+   db_id = get_db_id("Documents")
  else
    sid = get_sid("Manage")
+   db_id = get_db_id("Documents")
  end

  ws_id, q_id = create_roxy_workspace()
  raise ExitException.new("Can't create Roxy workspace in QConsole") unless ws_id && q_id

  db_id = get_any_db_id if db_id.nil? && sid.nil?

  # necessary to work around weirdness on windows
  headers = {
    'content-type' => 'text/plain'
  }

  url = "#{@protocol}://#{@hostname}:#{@qconsole_port}/qconsole/endpoints/evaler.xqy?wsid=#{ws_id}&qid=#{q_id}&action=eval&querytype=xquery&dirty=true"
  if db_id.present?
    url = url + "&dbid=#{db_id}"
+ end
+ if sid.present?
    url = url + "&sid=#{sid}"
  end
+ r = go(url, "post", headers, nil, query)

  delete_workspace(ws_id) if ws_id

  raise ExitException.new(JSON.pretty_generate(JSON.parse(r.body))) if r.body.match(/\{"error"/)

  r
end

@dmcassel dmcassel self-assigned this May 18, 2016
@dmcassel
Copy link
Collaborator Author

I'm working on a solution to this using /v1/eval.

@dmccreary
Copy link

Thanks for the fix. Just got this working on a new ML-9 test project.

@grtjn
Copy link
Contributor

grtjn commented Jul 12, 2016

Dev branch now contains a better way of executing queries against ML8 and 9. Closing this..

@grtjn grtjn closed this as completed Jul 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants