Hi,
What am I doing wrong? It was my impression that db:ouput was not executed until the database updates were completed.
However, when I execute:
let $db-name := 'Inve' return ( db:create-backup($db-name), db:output(db:backups($db-name)) )
The list of backups returned doesn't include the backup just added by db:create-backup(). I just tried with 8.6.3 to make sure it wasn't an older issue.
Thanks!
Dear France,
The argument of db:output will be cached before updates will be executed. Otherwise, out could be that the argument to be output does not exist anymore. Please see [1] for more information.
Best, Christian
[1] http://docs.basex.org/wiki/Database_Module#db:output
Am 20.04.2017 23:40 schrieb "France Baril" france.baril@architextus.com:
Hi,
What am I doing wrong? It was my impression that db:ouput was not executed until the database updates were completed.
However, when I execute:
let $db-name := 'Inve' return ( db:create-backup($db-name), db:output(db:backups($db-name)) )
The list of backups returned doesn't include the backup just added by db:create-backup(). I just tried with 8.6.3 to make sure it wasn't an older issue.
Thanks!
So I need to send 2 separate http requests or use a redirect? 1. Send request that creates backups 2. Send request that extracts the latest backup name from the list of all backups and returns it to me?
Any chance db:create-backup, could return the name of the new backup instead of an empty sequence?
I'm getting a lot of lag in my applications from having to perform so many calls or redirects to get anything from the server after an update.
Or maybe you have a better approach to propose?
So I need to send 2 separate http requests or use a redirect?
- Send request that creates backups
- Send request that extracts the latest backup name from the list of all
backups and returns it to me?
Exactly.
I'm getting a lot of lag in my applications from having to perform so many calls or redirects to get anything from the server after an update.
If the redirection should really turn out to be a lag (I wouldn’t hope so, because such a call should be really cheap), simply use rest:forward instead of rest:redirect [1].
Or maybe you have a better approach to propose?
Maybe you don’t really need the exact name of the backup, because db:restore can be called without timestamp [2].
Best, Christian
[1] http://docs.basex.org/wiki/RESTXQ#rest:forward [2] http://docs.basex.org/wiki/Database_Module#db:restore
The plan is not to restore straight from the data folder. I'm creating a script that:
1- Create a backup of all dbs 2- Rezip backups with AES256 encryption 3- Copies the encrypted backups to a remote location.
The double call works. The shell script didn't respond well to a redirect. I haven't tried the forward yet. I just thought there would be a way to do it in one operation. For this case, lag is not much of an issue because it's a shell and it's internal, but I've had similar cases in web applications with other functions, so I asked.
On Fri, Apr 21, 2017 at 4:26 AM, Christian Grün christian.gruen@gmail.com wrote:
So I need to send 2 separate http requests or use a redirect?
- Send request that creates backups
- Send request that extracts the latest backup name from the list of
all
backups and returns it to me?
Exactly.
I'm getting a lot of lag in my applications from having to perform so
many
calls or redirects to get anything from the server after an update.
If the redirection should really turn out to be a lag (I wouldn’t hope so, because such a call should be really cheap), simply use rest:forward instead of rest:redirect [1].
Or maybe you have a better approach to propose?
Maybe you don’t really need the exact name of the backup, because db:restore can be called without timestamp [2].
Best, Christian
[1] http://docs.basex.org/wiki/RESTXQ#rest:forward [2] http://docs.basex.org/wiki/Database_Module#db:restore
basex-talk@mailman.uni-konstanz.de