[basex-talk] connection question

2016-05-20 Thread Wang, Genneva
Hi basex gurus,

One other question. We internally have connection pools of 20 connecting to 
basex. While trying to do performance stress test using Jmeter, we found out 
that if we submit more than the configured connection pool, say submit 30 
connections, we noticed that the connection will not be recovered and the 
connection pool size will be in a un-recovereable stage (to pool size 0 
eventually).

I was just wondering does basex does any queueing on the receiving the incoming 
transactions, or is this something that the application needs to handle? Any 
tips would be greatly appreciated! Thank you very much.

Regards,
—Genneva


Re: [basex-talk] multiple inserts/update/deletes in single transaction

2016-05-20 Thread Wang, Genneva
Thanks everyone for your quick response. The information was very helpful!

Regards,
—Genneva

From: 
>
 on behalf of Dirk Kirsten >
Date: Friday, May 20, 2016 at 12:48 AM
To: 
"basex-talk@mailman.uni-konstanz.de" 
>
Subject: Re: [basex-talk] multiple inserts/update/deletes in single transaction

embedded


Re: [basex-talk] file:write - check, if path is existing

2016-05-20 Thread kleist-digital
Hi Marc,

thanks for the hint. In my case file:is-dir did it. Thanks again.

Günter

> Am 20.05.2016 um 08:24 schrieb Marc :
> 
> Hi Günter,
> in the file: you have the is-file function.
> Does'nt it do the job?
> Marc
> Le 19/05/2016 à 21:25, Günter Dunz-Wolff a écrit :
>> Hi all,
>> 
>> for the command file:write($path, distinct-values($list)) I have to check, 
>> if $path is existing (for example let $path := ´users/xxx/xxx/etc’.
>> How is it done in XQuery? Thanks for any help.
>> 
>> Cheers,
>> Günter
>> 
> 




Re: [basex-talk] multiple inserts/update/deletes in single transaction

2016-05-20 Thread Dirk Kirsten
Hello Kristian,

thanks for the pointer! The documentation is certainly misleading, I
agree. However, it is not wrong and I think the issue here is that RUN
can be used for two completely separate things: run an xquery file
(where it is indeed a single transaction, so the comment is appropriate)
and run a basex command script.

I personally would remove the second functionality (run a basex command
script) from the RUN command and instead include the functionality in
the already existing EXECUTE function. That way it would be clear: Use
RUN for xquery files, use EXECUTE for bxs.

I will discuss this with Christian Grün when he's back.

Cheers
Dirk

On 05/20/2016 09:41 AM, Kristian Kankainen wrote:
> Maybe it would be wise to change the documentation or specify what
> exactly is meant by the phrase "This command can be used to run
> several commands in a single transaction". Clearly it can be
> understood in a wrong way.
>
> Cheers
> Kristian
>
> 20.05.2016 09:59 Dirk Kirsten kirjutas:
>>
>> Hello Genneva,
>>
>> this is expected behaviour. BaseX script executed each command
>> separately. This is by design and required by the nature of XQuery
>> (Update), which by design always executes as one transaction - Which
>> can be difficult do deal with if you have a large amount of data and
>> have to e.g. hold it in memory.
>>
>> Each XQuery runs in one single transaction, so you can simply add
>> your documents via XQuery, e.g.
>>
>> db:add("DB", "embedded7.xml"),
>> db:add("DB", "embedded8.xml")
>>
>> Cheers
>>
>> Dirk
>>
>>
>> On 05/19/2016 08:11 PM, Wang, Genneva wrote:
>>> Hi 
>>>
>>> I’m trying to figure out whether batched transaction would work for
>>> basex, and I came across the RUN and EXECUTE command specified
>>> in http://files.basex.org/releases/8.4/BaseX84.pdf page 58-59.  The
>>> document mentioned following in the summary section:
>>>
>>> RUN:Evaluates the contents of file as XQuery expression. If the file
>>> ends with the suffix .bxs, the file content will be evaluated as
>>> command script. This command can be used to run several commands in
>>> a single transaction
>>> EXECUTE: Evaluates the specified input as command script. This
>>> command can be used to run several commands in a single transaction.
>>>
>>> I’ve tried this myself
>>> For example, I’d like to know if I batch 2 inserts, if one fails,
>>> would both inserts get rollback. 
>>>
>>> I’m using a simple .bxs (attached and also listed below for your
>>> convenience) and run the execute using GUI. 
>>>
>>> OPEN test
>>> ADD TO embedded7.xml embedded
>>> ADD TO embedded8.xml embedded
>>> CLOSE
>>>
>>> The second ADD (embedded8.xml) is  not a valid xml format so I’m
>>> expecting it to fail, and rollback both files if any of them have
>>> already added. But after executing this script, I’m seeing
>>> embedded7.xml have been added. 
>>>
>>> Would you be able to confirm if this is the expected behavior ? If
>>> so,  is there anyway that I can batch multiple inserts and ensures
>>> that these batch of files can be committed at the same time, and
>>> rollback  all together if any of the file has an error ?
>>>
>>> Thank you very much for your help. 
>>
>> -- 
>> Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
>> |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
>> |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
>> |   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
>> `-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] multiple inserts/update/deletes in single transaction

2016-05-20 Thread Kristian Kankainen
Maybe it would be wise to change the documentation or specify what 
exactly is meant by the phrase "This command can be used to run several 
commands in a single transaction". Clearly it can be understood in a 
wrong way.


Cheers
Kristian

20.05.2016 09:59 Dirk Kirsten kirjutas:


Hello Genneva,

this is expected behaviour. BaseX script executed each command 
separately. This is by design and required by the nature of XQuery 
(Update), which by design always executes as one transaction - Which 
can be difficult do deal with if you have a large amount of data and 
have to e.g. hold it in memory.


Each XQuery runs in one single transaction, so you can simply add your 
documents via XQuery, e.g.


db:add("DB", "embedded7.xml"),
db:add("DB", "embedded8.xml")

Cheers

Dirk


On 05/19/2016 08:11 PM, Wang, Genneva wrote:

Hi

I’m trying to figure out whether batched transaction would work for 
basex, and I came across the RUN and EXECUTE command specified in 
http://files.basex.org/releases/8.4/BaseX84.pdf page 58-59.  The 
document mentioned following in the summary section:


RUN:Evaluates the contents of file as XQuery expression. If the file 
ends with the suffix .bxs, the file content will be evaluated as 
command script. This command can be used to run several commands in a 
single transaction
EXECUTE: Evaluates the specified input as command script. This 
command can be used to run several commands in a single transaction.


I’ve tried this myself
For example, I’d like to know if I batch 2 inserts, if one fails, 
would both inserts get rollback.


I’m using a simple .bxs (attached and also listed below for your 
convenience) and run the execute using GUI.


OPEN test
ADD TO embedded7.xml embedded
ADD TO embedded8.xml embedded
CLOSE

The second ADD (embedded8.xml) is  not a valid xml format so I’m 
expecting it to fail, and rollback both files if any of them have 
already added. But after executing this script, I’m seeing 
embedded7.xml have been added.


Would you be able to confirm if this is the expected behavior ? If 
so,  is there anyway that I can batch multiple inserts and ensures 
that these batch of files can be committed at the same time, and 
rollback  all together if any of the file has an error ?


Thank you very much for your help.


--
Dirk Kirsten, BaseX GmbH,http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22




Re: [basex-talk] Stopping the http server

2016-05-20 Thread Dirk Kirsten
Hello France,

good that you ping, bit I actually have the same problem about being a
programmer and not a sysadmin :) So take everything I say with a grain
of salt. So you start up your jetty as outline in the Jetty documentation:

java -jar jetty-runner.jar --stop-port 8181 --stop-key abc123> java -jar 
jetty-runner.jar --stop-port 8181 --stop-key abc123

and there you can give it any stop keys you want. Within the library path of 
Jetty you put your BaseX.jar and that way you will be able to use XQuery/RESTXQ.
When you download e.g. our zip distribution it is already bundled the other way 
round, i.e. jetty is included in the library path of BaseX and we start Jetty 
automatically.

I hope that clears up things a little and best regards
Dirk


On 05/18/2016 11:31 PM, France Baril wrote:
> I'm pinging you again with my question in case it slipped through the
> cracks...
>
> On Thu, May 12, 2016 at 6:19 PM, France Baril
> >
> wrote:
>
> I'm not sure I understand how to do that. If the call to baseX.jar
> start has everything embedded together, how would I split it up to
> control each part?
>
> I'm a programmer, not a sysadmin, so it might be a basic question,
> but I'm not finding anything in the doc.
>
>
>
>
> -- 
> France Baril
> Architecte documentaire / Documentation architect
> france.ba...@architextus.com 

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] multiple inserts/update/deletes in single transaction

2016-05-20 Thread Dirk Kirsten
Hello Genneva,

this is expected behaviour. BaseX script executed each command
separately. This is by design and required by the nature of XQuery
(Update), which by design always executes as one transaction - Which can
be difficult do deal with if you have a large amount of data and have to
e.g. hold it in memory.

Each XQuery runs in one single transaction, so you can simply add your
documents via XQuery, e.g.

db:add("DB", "embedded7.xml"),
db:add("DB", "embedded8.xml")

Cheers

Dirk


On 05/19/2016 08:11 PM, Wang, Genneva wrote:
> Hi 
>
> I’m trying to figure out whether batched transaction would work for
> basex, and I came across the RUN and EXECUTE command specified
> in http://files.basex.org/releases/8.4/BaseX84.pdf page 58-59.  The
> document mentioned following in the summary section:
>
> RUN:Evaluates the contents of file as XQuery expression. If the file
> ends with the suffix .bxs, the file content will be evaluated as
> command script. This command can be used to run several commands in a
> single transaction
> EXECUTE: Evaluates the specified input as command script. This command
> can be used to run several commands in a single transaction.
>
> I’ve tried this myself
> For example, I’d like to know if I batch 2 inserts, if one fails,
> would both inserts get rollback. 
>
> I’m using a simple .bxs (attached and also listed below for your
> convenience) and run the execute using GUI. 
>
> OPEN test
> ADD TO embedded7.xml embedded
> ADD TO embedded8.xml embedded
> CLOSE
>
> The second ADD (embedded8.xml) is  not a valid xml format so I’m
> expecting it to fail, and rollback both files if any of them have
> already added. But after executing this script, I’m seeing
> embedded7.xml have been added. 
>
> Would you be able to confirm if this is the expected behavior ? If so,
>  is there anyway that I can batch multiple inserts and ensures that
> these batch of files can be committed at the same time, and rollback
>  all together if any of the file has an error ?
>
> Thank you very much for your help. 

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] file:write - check, if path is existing

2016-05-20 Thread Marc

Hi Günter,
in the file: you have the is-file function.
Does'nt it do the job?
Marc
Le 19/05/2016 à 21:25, Günter Dunz-Wolff a écrit :

Hi all,

for the command file:write($path, distinct-values($list)) I have to check, if 
$path is existing (for example let $path := ´users/xxx/xxx/etc’.
How is it done in XQuery? Thanks for any help.

Cheers,
Günter