[Cubicweb] Which way to go to do remote RQL ?

Nicolas Chauvat nicolas.chauvat at logilab.fr
Wed Aug 13 21:22:12 CEST 2014


On Fri, Aug 08, 2014 at 09:36:10AM +0200, Yann Cointepas wrote:
> However, during the insertion process, I need to query the database (taking
> [...]
> It still seems difficult to me to put this in a single transaction with
> rqlcontroller.
> [...]
> * This example is stupid because I could create all StudyDefinition before
> insertion but I have other, however more complex, similar situations.

Your use case is clear, but HTTP is connection-less. I believe that if
you want actual database transactions with proper isolation your best
option today is to read the code of rqlcontroller for inspiration, and
code something in the web server that acts as a proxy, by implementing
the workflow I described earlier using a Transaction object. When
creating a Transaction object on the server, the web server would
create a rql transaction to the underlying repository and when later
committing or rollbacking that transaction object, the web server
would propagate your command. A timeout on that object could be useful
in order not to keep it around forever if the script that created it
forgets to commit/rollback in the end.

Bypassing the web server and directly accessing the repository with a
remote client used to be possible (with Pyro and zmq), but the feature
eventually died in a dark corner. Is it what you were actually wishing

Nicolas Chauvat

logilab.fr - services en informatique scientifique et gestion de connaissances  

More information about the Cubicweb mailing list