Persistence Layer: Lease implementation

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Persistence Layer: Lease implementation

bruno.buzzi
Hi,

I'm implementing the Lease on my persistence layer.

If i try access a form at:
..../orbeon/fr/my-form/test-lease/edit/b05b00ef098c670971429d226b2462d70e07f9e3

I got the message:
Another user, with username "{0}", currently owns a lease on this document.

The above url is calling the service:
/crud/{3}/{2}/form/form.xhtml?document={1}

This service actually answer the XML definition of the instance
b05b00ef098c670971429d226b2462d70e07f9e3.

Is there any header i have to set ? Or any other option ?

I have read
https://doc.orbeon.com/form-runner/apis/persistence-api/lease-api but there
is not mention to the initial GET of a form and where i should tell Orbeon
if the document is leased or not.

Maybe i'missing something.

regards,
bruno

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: Lease implementation

bruno.buzzi
Hi,

The lock and unlock operations are get or put http verbs ¿

Regards,
Bruno

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: Lease implementation

Alessandro  Vernet
Administrator
Hi Bruno,

They are the actual `LOCK` and `UNLOCK` verbs, from WebDAV. And that
`<d:lockinfo>` response document also comes from WebDAV. We tried to reuse
what is defined in WebDAV, instead of re-inventing something similar. You'll
let me know if this helps.

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: Lease implementation

bruno.buzzi
Alex,

Now the lease is implemented with lock and unlock verbs but i got the same
result. :(
See the stack below.

If i do a curl from Orbeon OS with same url (in the stack)  i got 200 ok as
expected:
curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X LOCK
http.142:8787/orbeon-gemstone-api/crud/agesic/test-lease/data/b05b00ef098c670971429d226b2462d70e07f9e3/data.xml

result:
OK

The url in the curl command is the same as the stack.
Orbeon got a null from my service but i do not see any LOCK request coming
from Orbeon.

Still researching on this issue ...

Stack:
2018-06-20 13:57:47,504 INFO  lifecycle  - event: {"request": "79",
"session": "18FF4575FBB611758EEEC072F5A64E0A", "source": "service",
"message": "start: handle", "path":
"/fr/service/persistence/crud/agesic/test-lease/data/b05b00ef098c670971429d226b2462d70e07f9e3/data.xml",
"method": "LOCK"}
2018-06-20 13:57:47,504 INFO  ProcessorService  -
/fr/service/persistence/crud/agesic/test-lease/data/b05b00ef098c670971429d226b2462d70e07f9e3/data.xml
- Received request
2018-06-20 13:57:47,526 ERROR PageFlowControllerProcessor  - error caught
{controller: "oxf:/apps/fr/page-flow.xml", method: "LOCK", path:
"/fr/service/persistence/crud/agesic/test-lease/data/b05b00ef098c670971429d226b2462d70e07f9e3/data.xml"}
2018-06-20 13:57:47,537 ERROR PageFlowControllerProcessor  -
+----------------------------------------------------------------------------------------------------------------------+
|An Error has Occurred                                                                                                
|
|----------------------------------------------------------------------------------------------------------------------|
|org.orbeon.oxf.common.ValidationException:
http://192.168.29.142:8787/orbeon-gemstone-api/crud/agesic/test-lease/data/|
|b05b00ef098c670971429d226b2462d70e07f9e3/data.xml: null                                                              
|
|----------------------------------------------------------------------------------------------------------------------|
|Application Call Stack                                                                                              
|
|----------------------------------------------------------------------------------------------------------------------|
|oxf:/apps/fr/page-flow.xml                                                      
|reading page model data output|  18|
|······················································································································|
|element=<service path="/fr/service/persistence/.*"
model="persistence/proxy.xpl"/>                                    |
|model  =persistence/proxy.xpl                                                                                        
|
|----------------------------------------------------------------------------------------------------------------------|

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: Lease implementation

Alessandro  Vernet
Administrator
Hi Bruno,

Do you know what request is being sent to your implementation by Orbeon
Forms? (Looks like this is a case where using WireShark would come in
handy!)

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: Lease implementation

bruno.buzzi
Hi Alex,

Using tshark i do no see any lease request to the persistence layer.

*From a web browser i go to*:
http://192.168.29.129:8080/orbeon/fr/agesic/test-lease/edit/b05b00ef098c670971429d226b2462d70e07f9e3

*On my terminal with tshark command*:
[orbeon@localhost /]$ sudo tshark -i any 'tcp port 8787 and (((ip[2:2] -
((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' -R 'http.request.method ==
"GET" || http.request.method == "HEAD"'

*i see the following*:
tshark: -R without -2 is deprecated. For single-pass filtering use -Y.
Running as user "root" and group "root". This could be dangerous.
Capturing on 'any'
  1 0.000000000 192.168.29.129 -> 192.168.29.142 HTTP 716 GET
/orbeon-gemstone-api/crud/agesic/test-lease/form/form.xhtml?document=b05b00ef098c670971429d226b2462d70e07f9e3
HTTP/1.1
---------------------------------------------------------------------------------------------

The HTTP 176 GET above is related to the service
/crud/{app}/{form}/form/form.xhtml?document={id} but i do not see any lock
to the lease.
The browser show the following screen:
<http://discuss.orbeon.com/file/t374762/lease-01.png>

*On orbeon.log i have the following*:
2018-06-22 09:42:03,902 ERROR PageFlowControllerProcessor  - error caught
{controller: "oxf:/apps/fr/page-flow.xml", method: "LOCK", path:
"/fr/service/persistence/crud/agesic/test-lease/data/b05b00ef098c670971429d226b2462d70e07f9e3/data.xml"}
2018-06-22 09:42:03,925 ERROR PageFlowControllerProcessor  -
+----------------------------------------------------------------------------------------------------------------------+
|An Error has Occurred                                                                                                
|
|----------------------------------------------------------------------------------------------------------------------|
|org.orbeon.oxf.common.ValidationException:
http://192.168.29.142:8787/orbeon-gemstone-api/crud/agesic/test-lease/data/|
|b05b00ef098c670971429d226b2462d70e07f9e3/data.xml: null                                                              
|
|----------------------------------------------------------------------------------------------------------------------|
|Application Call Stack                                                                                              
|
|----------------------------------------------------------------------------------------------------------------------|
|oxf:/apps/fr/page-flow.xml                                                      
|reading page model data output|  18|
|······················································································································|
|element=<service path="/fr/service/persistence/.*"
model="persistence/proxy.xpl"/>                                    |
|model  =persistence/proxy.xpl                                                                                        
|

I do not know why orbeon.log is showing a call with a lock verb but this
call is not displayed on tshark.

Still researching...

regards,
bruno

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: Lease implementation

bruno.buzzi
Hi Alex,

Forgot to mention in the previous post that i also tried:
sudo tshark -i any 'tcp port 8787 and (((ip[2:2] - ((ip[0]&0xf)<<2)) -
((tcp[12]&0xf0)>>2)) != 0)' -R 'http.request'

This capture all requests but i do not see any LOCK method being called.

Hope this help to figure out what is happening....

regards,
bruno

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: Lease implementation

Alessandro  Vernet
Administrator
In reply to this post by bruno.buzzi
Hi Bruno,

Could you attach a log file that includes the full `ValidationException` you
were showing an excerpt of in your previous message?

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: Lease implementation

bruno.buzzi
ALex,

orbeon.log <http://discuss.orbeon.com/file/t374762/orbeon.log>  

The orbeon.log is attached to this post.

You will find the LOCK errrors in line: 1846 and 7080 (two different lock
errors).

regards,
bruno

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: Lease implementation

Alessandro  Vernet
Administrator
Thank you Bruno. I've reproduced the issue, and it is completely on our side:
we lack the proper support the `LOCK` and `UNLOCK` methods for external
requests! I'm currently looking at this to see if this is something we can
add quickly. I'll make sure to follow-up here once I know more about this.

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: Lease implementation

Alessandro  Vernet
Administrator
Bruno, this is now fixed – it was a simple one. For reference, I've included
a link to the corresponding issue below, and I'll follow-up with a link to a
test build once the build system produced one.

https://github.com/orbeon/orbeon-forms/issues/3643

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: Lease implementation

Alessandro  Vernet
Administrator
Bruno, the fix will be included in 2018.1 and here is a test build that
includes it. You'll let me know if it solves the issue you were having. And
I apologize for all the trouble!

https://s3.amazonaws.com/orbeon-builds/orbeon/orbeon-forms-pe/2129/2129.2/build/distrib/orbeon-2018.1-SNAPSHOT.201806262219-PE.zip

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: Lease implementation

Alessandro  Vernet
Administrator
Just curious Bruno, did you get a chance to try the build linked in my
previous message? If so, does it fix the issue you were seeing with the
LOCK/UNLOCK not being called?

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: Lease implementation

bruno.buzzi
Alex,

i'm going to do it before the weekend and i will post the results here.

regards,
bruno

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: Lease implementation

bruno.buzzi
Alex,

Excellent !!!

Now the lock and unlock requests are comming !

Finishing the Persistence Layer implementation now.

regards,
bruno

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: Lease implementation

bruno.buzzi
Alex,

Good news !.

GemStone/S PL now support lease operation.

regards,
bruno

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: Lease implementation

Alessandro  Vernet
Administrator
Excellent Bruno! And thank you for your patience.

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet