Python client issue
Friday, 30 March 2018 · 4 messages · last reply 4 Apr 2018
AF
Andrey Fedosenko30 Mar 2018 12:43 #
session = BaseXClient.Session('localhost', 1984, 'admin', 'admin')
session2 = BaseXClient.Session('localhost', 1984, 'admin', 'admin') session2.execute("check database")
query = session.query("collection('database')")
for code, item in query.iter():
//some item modification
session2.replace("{}.xml".format(item_path), modified_item)
The execution of the script stops after the first iteration. How can I read and change data in a single cycle?
FYI: for a small database, this works correctly.
CG
Christian Grün31 Mar 2018 16:50 #
Hi Andrey,
I’ve seen you’ve opened a GitHub issue as well. In order to tell if this is a bug, and if it’s a bug specific to Python, you may need to provide us a complete code example first. Does the problem also occur with a single client session?
Best,
Christian
Quoted text · Andrey Fedosenko · 17 lines
On Fri, Mar 30, 2018 at 12:43 PM, Andrey Fedosenko <andrey.fedosenko at startmatter.com> wrote: > session = BaseXClient.Session('localhost', 1984, 'admin', 'admin') > > session2 = BaseXClient.Session('localhost', 1984, 'admin', 'admin') > session2.execute("check database") > > query = session.query("collection('database')") > > for code, item in query.iter(): > //some item modification > session2.replace("{}.xml".format(item_path), modified_item) > > > The execution of the script stops after the first iteration. How can I > read and change data in a single cycle? > FYI: for a small database, this works correctly.
AF
Andrey Fedosenko4 Apr 2018 13:06 #
Hi Christian,
I left a response in my GitHub issue.
2018-03-31 17:50 GMT+03:00 Christian Grün <christian.gruen at gmail.com>:
Quoted text · Christian Grün · 29 lines
> Hi Andrey, > > I’ve seen you’ve opened a GitHub issue as well. In order to tell if > this is a bug, and if it’s a bug specific to Python, you may need to > provide us a complete code example first. Does the problem also occur > with a single client session? > > Best, > Christian > > > > On Fri, Mar 30, 2018 at 12:43 PM, Andrey Fedosenko > <andrey.fedosenko at startmatter.com> wrote: >> session = BaseXClient.Session('localhost', 1984, 'admin', 'admin') >> >> session2 = BaseXClient.Session('localhost', 1984, 'admin', 'admin') >> session2.execute("check database") >> >> query = session.query("collection('database')") >> >> for code, item in query.iter(): >> //some item modification >> session2.replace("{}.xml".format(item_path), modified_item) >> >> >> The execution of the script stops after the first iteration. How can I >> read and change data in a single cycle? >> FYI: for a small database, this works correctly.
CG
Christian Grün4 Apr 2018 14:39 #
Thanks; on my list. If you happen to be able to give feedback to other clients in the issue, that’d be marvellous.
Quoted text · Andrey Fedosenko · 36 lines
On Wed, Apr 4, 2018 at 1:06 PM, Andrey Fedosenko <andrey.fedosenko at startmatter.com> wrote: > Hi Christian, > > I left a response in my GitHub issue. > > 2018-03-31 17:50 GMT+03:00 Christian Grün <christian.gruen at gmail.com>: >> Hi Andrey, >> >> I’ve seen you’ve opened a GitHub issue as well. In order to tell if >> this is a bug, and if it’s a bug specific to Python, you may need to >> provide us a complete code example first. Does the problem also occur >> with a single client session? >> >> Best, >> Christian >> >> >> >> On Fri, Mar 30, 2018 at 12:43 PM, Andrey Fedosenko >> <andrey.fedosenko at startmatter.com> wrote: >>> session = BaseXClient.Session('localhost', 1984, 'admin', 'admin') >>> >>> session2 = BaseXClient.Session('localhost', 1984, 'admin', 'admin') >>> session2.execute("check database") >>> >>> query = session.query("collection('database')") >>> >>> for code, item in query.iter(): >>> //some item modification >>> session2.replace("{}.xml".format(item_path), modified_item) >>> >>> >>> The execution of the script stops after the first iteration. How can I >>> read and change data in a single cycle? >>> FYI: for a small database, this works correctly.
Written for BaseX 9.0. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery