BaseX rest and PHP

Tuesday, 12 November 2013 · 3 messages · last reply 13 Nov 2013
LJ
Lars Johnsen12 Nov 2013 19:27 #
Hi all This is a question for those with experience using PHP with BaseX and the rest interface. There is a peculiar case of lag for queries, and I wondered if it had to with how PHPdoes things, or if it is how BaseX does things (or if there is something else). This may be a long shot, but I still give it a try. The setup is fairly straight forward, with queries sent from a html-page via a PHPscript which places the call: file_get_contents(basex-rest-URL). The result is then sent back to the requesting html page. The problem is that this sometimes hangs: two or three queries then it stops or takes an awful lot of time. The peculiar thing is that the basex-rest-URL, when typed directly into browser address line, receives an immediate response, even while it is still being processed by the html-php-basex cycle. Sometimes the cycle gives an answer, sometimes not. The cycle do work when file_get_contents is directed towards an SQLite database, so it seems that there is something going on in the communication between PHP and BaseX. Any ideas? Regards Lars G Johnsen National Library of Norway
CG
Christian Grün13 Nov 2013 14:20 #
Hi Lars, I’m also interested in the feedback of other mailing list readers, as we haven’t encountered such problems with the rest interface so far. The HTTP response could shed some light on the problem, though; could you please send us the HTTP response header for the calls to BaseX and SQLite? It can e. g. be caught with the command-line tool curl and the upper-case flag "-I". Thanks, Christian
Quoted text · Lars Johnsen · 39 lines
On Tue, Nov 12, 2013 at 7:27 PM, Lars Johnsen <yoonsen at gmail.com> wrote: > Hi all > > This is a question for those with experience using PHP with BaseX and the > rest interface. > > There is a peculiar case of lag for queries, and I wondered if it had to > with how PHPdoes things, or if it is how BaseX does things (or if there is > something else). This may be a long shot, but I still give it a try. > > The setup is fairly straight forward, with queries sent from a html-page via > a PHPscript which places the call: > > file_get_contents(basex-rest-URL). > > The result is then sent back to the requesting html page. The problem is > that this sometimes hangs: two or three queries then it stops or takes an > awful lot of time. > > The peculiar thing is that the basex-rest-URL, when typed directly into > browser address line, receives an immediate response, even while it is still > being processed by the html-php-basex cycle. Sometimes the cycle gives an > answer, sometimes not. The cycle do work when file_get_contents is directed > towards an SQLite database, so it seems that there is something going on in > the communication between PHP and BaseX. > > Any ideas? > > Regards > Lars G Johnsen > National Library of Norway > > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
YM
Yoann Maingon13 Nov 2013 14:30 #
This is reminds me of something... We exchanged about that a while ago with christian for the development of mysimplegrid. I'll try to look in my archives. *Cordialement / Best Regards, * *Yoann Maingon* Minerva France *+33 6 64 32 49 66* Download Aras Innovator - Téléchargez Aras Innovator<http://www.aras.com/support/downloads/downloadInnovator.aspx> 2013/11/13 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 63 lines
> Hi Lars, > > I’m also interested in the feedback of other mailing list readers, as > we haven’t encountered such problems with the rest interface so far. > > The HTTP response could shed some light on the problem, though; could > you please send us the HTTP response header for the calls to BaseX and > SQLite? It can e. g. be caught with the command-line tool curl and the > upper-case flag "-I". > > Thanks, > Christian > ___________________________ > > On Tue, Nov 12, 2013 at 7:27 PM, Lars Johnsen <yoonsen at gmail.com> wrote: > > Hi all > > > > This is a question for those with experience using PHP with BaseX and the > > rest interface. > > > > There is a peculiar case of lag for queries, and I wondered if it had to > > with how PHPdoes things, or if it is how BaseX does things (or if there > is > > something else). This may be a long shot, but I still give it a try. > > > > The setup is fairly straight forward, with queries sent from a html-page > via > > a PHPscript which places the call: > > > > file_get_contents(basex-rest-URL). > > > > The result is then sent back to the requesting html page. The problem is > > that this sometimes hangs: two or three queries then it stops or takes an > > awful lot of time. > > > > The peculiar thing is that the basex-rest-URL, when typed directly into > > browser address line, receives an immediate response, even while it is > still > > being processed by the html-php-basex cycle. Sometimes the cycle gives an > > answer, sometimes not. The cycle do work when file_get_contents is > directed > > towards an SQLite database, so it seems that there is something going on > in > > the communication between PHP and BaseX. > > > > Any ideas? > > > > Regards > > Lars G Johnsen > > National Library of Norway > > > > > > > > _______________________________________________ > > BaseX-Talk mailing list > > BaseX-Talk at mailman.uni-konstanz.de > > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >

⚡Generated with XQuery