xmldb:login versus session:set-current-user

View: New views
2 Messages — Rating Filter:   Alert me  

xmldb:login versus session:set-current-user

by Chris Tomlinson-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

We are running two versions of eXist: 1.1rc2-newcore and 1.2.4. We are performing an update from XQuery via:

update insert <o:subject class="{$rid}" type="{$usage}">{ data($pnm) }</o:subject> into $node

where $node is defined via:

let $node := collection($tbrc-q:outline-db-path)//o:node[@RID = $node-rid]

The update works as expected on eXist 1.2.4 when we use:

xmldb:login("/db", $user, $pw)

However, on 1.1rc2-newcore we get:

Update complete:  <z:results type="addSubjects" xmlns:z="http://www.tbrc.org/models/results#" status="exception" exmsg="permission to remove document denied [at line 175, column 9]
In call to function:
tbrc-q:addSubjects-to-node(element*, xs:string*, xs:string*) [186:15]
tbrc-q:addSubjects(xs:string*, xs:string*, xs:string*) [1:139]"/>

line 175 is the "update".Why are we getting "permission to remove document denied"?

When we try "session:set-current-user($user, $pw)" it fails on both 1.1rc2-newcore and 1.2.4. The error on 1.1rc2-newcore is:

Update complete:  <z:results type="addSubjects" xmlns:z="http://www.tbrc.org/models/results#" status="exception" exmsg="Variable $request is not bound to an Java object. [at line 1, column 139]
In call to function:
tbrc-q:addSubjects(xs:string*, xs:string*, xs:string*) [1:139]"/>

on 1.2.4 the error seems a little more informative:

Update complete:  <z:results type="addSubjects" xmlns:z="http://www.tbrc.org/models/results#" status="exception" exmsg="No request object found in the current XQuery context. [at line 181, column 18]
In call to function:
tbrc-q:addSubjects(xs:string*, xs:string*, xs:string*) [1:139]"/>

I apologize if this is a really ill-considered question but generally we are able to make things work nicely with eXist but this is a confusing situation. We've generally always done updates via Java and the xmldb:api which works fine but now we are trying to do updates via XQuery from a GWT application.

Thank you very much for any help,
Chris

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Parent Message unknown Re: xmldb:login versus session:set-current-user

by Chris Tomlinson-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well I have discovered that if the full URI form of the collection path is used with xmldb:login then the code we have will work on both 1.1rc2 and 1.2.4. I guess that 1.2.4 is a little more lenient about the form of the collection path.

I'm still not understanding what the problem is with the usage of session:set-current-user in both 1.1rc2 and 1.2.4. I also don't understand when one should be used versus the other.

Thank you,
Chris


On Sep 15, 2008, at 2:25 PM, Chris Tomlinson wrote:

Hello,

We are running two versions of eXist: 1.1rc2-newcore and 1.2.4. We are performing an update from XQuery via:

update insert <o:subject class="{$rid}" type="{$usage}">{ data($pnm) }</o:subject> into $node

where $node is defined via:

let $node := collection($tbrc-q:outline-db-path)//o:node[@RID = $node-rid]

The update works as expected on eXist 1.2.4 when we use:

xmldb:login("/db", $user, $pw)

However, on 1.1rc2-newcore we get:

Update complete:  <z:results type="addSubjects" xmlns:z="http://www.tbrc.org/models/results#" status="exception" exmsg="permission to remove document denied [at line 175, column 9]
In call to function:
tbrc-q:addSubjects-to-node(element*, xs:string*, xs:string*) [186:15]
tbrc-q:addSubjects(xs:string*, xs:string*, xs:string*) [1:139]"/>

line 175 is the "update".Why are we getting "permission to remove document denied"?

When we try "session:set-current-user($user, $pw)" it fails on both 1.1rc2-newcore and 1.2.4. The error on 1.1rc2-newcore is:

Update complete:  <z:results type="addSubjects" xmlns:z="http://www.tbrc.org/models/results#" status="exception" exmsg="Variable $request is not bound to an Java object. [at line 1, column 139]
In call to function:
tbrc-q:addSubjects(xs:string*, xs:string*, xs:string*) [1:139]"/>

on 1.2.4 the error seems a little more informative:

Update complete:  <z:results type="addSubjects" xmlns:z="http://www.tbrc.org/models/results#" status="exception" exmsg="No request object found in the current XQuery context. [at line 181, column 18]
In call to function:
tbrc-q:addSubjects(xs:string*, xs:string*, xs:string*) [1:139]"/>

I apologize if this is a really ill-considered question but generally we are able to make things work nicely with eXist but this is a confusing situation. We've generally always done updates via Java and the xmldb:api which works fine but now we are trying to do updates via XQuery from a GWT application.

Thank you very much for any help,
Chris


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open
LightInTheBox - Buy quality products at wholesale price!