Thank you Christian,

I checked the issue of the subject with the latest release and now it is working.
But the BaseX843-20160407 release introduces a different issue (supposedly), that is a java.lang.StackOverflowError exception you can reproduce implementing a restxq with a recursive function, as in the following example:
---
module namespace api = "urn:api";

declare function api:fact($val) {
  if ($val = 1) then 1
  else $val * api:fact($val - 1)
};

declare
  %rest:path('myapi/{$v}')
  %rest:GET
function api:impl_GET($v) {
    <result>{api:fact($v)}</result>
};
---
Regards,
Vincenzo

2016-04-06 15:48 GMT+02:00 Christian Grün <christian.gruen@gmail.com>:
Il problema è risolto [1,2]; grazie di nuovo.

[1] https://github.com/BaseXdb/basex/issues/1281
[2] http://files.basex.org/releases/latest/



On Tue, Apr 5, 2016 at 12:53 PM, Christian Grün
<christian.gruen@gmail.com> wrote:
> Thanks Vincenzo,
>
> I could reproduce the problem [1], and we’ll fix it soon.
>
> Generally, I’d recommend you to avoid declaration of variables that
> will never be used. You could rewrite your code as follows:
>
>    db:add('testdb', <aaa/>, '111.xml'),
>    <ok/>
>
> Hope this helps,
> Christian
>
> [1] https://github.com/BaseXdb/basex/issues/1281
>
>
>
> On Mon, Apr 4, 2016 at 10:30 AM, Vincenzo Cestone <v.cestone@gmail.com> wrote:
>> Hi guys,
>>
>> in the new basex 8.4.2 version I cannot write on the db via restxq.
>>
>> For example if you create an empty 'testdb',
>> set in the .basex conf file the option MIXUPDATES = true,
>> and call the '/dbaddtest' restxq implemented as in the following:
>> ---
>> module namespace o = "test";
>>
>> declare
>>   %rest:path("/dbaddtest")
>>   %rest:GET
>> function o:dbaddtest() {
>>   let $o := db:add('testdb', <aaa/>, '111.xml')
>>   return <ok/>
>> };
>> ---
>> it will not work in the basex 8.4.2 i.e. the document is not added to the
>> db, but it will return <ok/> without errors.
>> On the contrary the db:add executed in the BaseX.jar client is working well.
>>
>> And also the above restxq code is working as expected in the basex 8.3.1
>> version.
>>
>> Thank you in advance.
>>
>> Regards,
>> Vincenzo
>>
>>