Re: [basex-talk] Applicative Cache

2015-11-20 Thread Etanchaud Fabrice
I am afraid that this would not work.
If you do not create the mainmem database at server's initialization,
but afterwards from a client,
then the database lives as long as the client's connection.
So using the client module in a RESTXQ request will not help, because 
connection is closed at the end of the request.

Currently, I use a basexclient for that, and keep the client console open, to 
prevent the mainmem db from closing.

Best regards,
Fabrice

-Message d'origine-
De : Christian Grün [mailto:christian.gr...@gmail.com] 
Envoyé : vendredi 20 novembre 2015 15:28
À : Marco Lettere 
Cc : Etanchaud Fabrice ; 
basex-talk@mailman.uni-konstanz.de
Objet : Re: [basex-talk] Applicative Cache

> What about running from within a RESTXQ a 
> client:connect/client:execute against the coupled db server that has 
> been configured to startup like suggested by Fabrice (-c"SET MAINMEM 
> TRUE;CREATE DB mainmem")?

…Marco’s approach ;) I agree, this would be possible! Looking forward to your 
experiences.

Christian


Re: [basex-talk] Applicative Cache

2015-11-20 Thread Christian Grün
> What about running from within a RESTXQ a client:connect/client:execute
> against the coupled db server that has been configured to startup like
> suggested by Fabrice (-c"SET MAINMEM TRUE;CREATE DB mainmem")?

…Marco’s approach ;) I agree, this would be possible! Looking forward
to your experiences.

Christian


Re: [basex-talk] Applicative Cache

2015-11-20 Thread Marco Lettere

Hi Christian,

On 20/11/2015 13:12, Christian Grün wrote:

True! I have reintroduced that feature in the latest snapshot [1].
Spontaneously, I would say there’s currently no way to realize this
for web applications. I could add the -c flag for BaseXHTTP as well.
@Marco: Do you think this would be helpful?

It might be helpful.
What about running from within a RESTXQ a client:connect/client:execute 
against the coupled db server that has been configured to startup like 
suggested by Fabrice (-c"SET MAINMEM TRUE;CREATE DB mainmem")?
Just for my understanding, would this be equivalent? Because in that 
case I could already give it a try by downloading the latest snapshot.

Thanks,
Marco.


Please note that it’s not possible to open existing databases in main
memory [2]..

Christian

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


On Mon, Nov 9, 2015 at 5:08 PM, Etanchaud Fabrice
 wrote:

Hi Marco,

I did a few tests in that configuration last year (not with 8.X version),
And it worked, as long as I did not "OPEN" another database.

Server :

java -cp "%CP%" %BASEX_JVM% org.basex.BaseXServer %* -c"SET MAINMEM TRUE;CREATE DB 
mainmem"

Client :


xquery db:open('mainmem')

Stopped at ., 1/9:
[bxerr:BXDB0002] Database 'mainmem' was not found.

Best regards,
Fabrice

-Message d'origine-
De : basex-talk-boun...@mailman.uni-konstanz.de 
[mailto:basex-talk-boun...@mailman.uni-konstanz.de] De la part de Marco Lettere
Envoyé : lundi 9 novembre 2015 16:29
À : BaseX 
Objet : [basex-talk] Applicative Cache

Hi all,
I went though the emails talking about mainmemory databases and related but 
I've not been able to find an answer to this loud thinking ...
Would it be possible to create an in memory database with a RESTXQ call and 
keep it accessible for other RESTXQ invocations as if it was a disk db 
throughout the lifecycle of a basexhttp server?
Application level cacheing of (possibly distributed) dbs or management of 
transient volatile data items like tokens are the scenarios I have in mind.
Just wondering whether this makes any sense. Whether it's feasible or whether 
someone already did this with other means.
Thanks a lot!
Marco.




Re: [basex-talk] Applicative Cache

2015-11-20 Thread Etanchaud Fabrice
Thank you Christian !

By the way, I did not succeed in trying to connect the basehttpserver to an 
already running basexserver (in order to use the -c option for mainmemory db 
creation).
I used the -n,p,U,P options.
Is it possible to manage this kind of configuration, aside the local or brand 
new server configurations ?

Best regards,
Fabrice


-Message d'origine-
De : Christian Grün [mailto:christian.gr...@gmail.com] 
Envoyé : vendredi 20 novembre 2015 13:13
À : Etanchaud Fabrice 
Cc : Marco Lettere ; 
basex-talk@mailman.uni-konstanz.de
Objet : Re: [basex-talk] Applicative Cache

Hi Fabrice, hi Marco,

> But I tested it again with 8.3, and did not succeed in sharing a server side 
> mainmem db.

True! I have reintroduced that feature in the latest snapshot [1].
Spontaneously, I would say there’s currently no way to realize this for web 
applications. I could add the -c flag for BaseXHTTP as well.
@Marco: Do you think this would be helpful?

Please note that it’s not possible to open existing databases in main memory 
[2]..

Christian

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


On Mon, Nov 9, 2015 at 5:08 PM, Etanchaud Fabrice 
 wrote:
> Hi Marco,
>
> I did a few tests in that configuration last year (not with 8.X 
> version), And it worked, as long as I did not "OPEN" another database.
>
> Server :
>
> java -cp "%CP%" %BASEX_JVM% org.basex.BaseXServer %* -c"SET MAINMEM 
> TRUE;CREATE DB mainmem"
>
> Client :
>
>> xquery db:open('mainmem')
> Stopped at ., 1/9:
> [bxerr:BXDB0002] Database 'mainmem' was not found.
>
> Best regards,
> Fabrice
>
> -Message d'origine-
> De : basex-talk-boun...@mailman.uni-konstanz.de 
> [mailto:basex-talk-boun...@mailman.uni-konstanz.de] De la part de 
> Marco Lettere Envoyé : lundi 9 novembre 2015 16:29 À : BaseX 
> 
> Objet : [basex-talk] Applicative Cache
>
> Hi all,
> I went though the emails talking about mainmemory databases and related but 
> I've not been able to find an answer to this loud thinking ...
> Would it be possible to create an in memory database with a RESTXQ call and 
> keep it accessible for other RESTXQ invocations as if it was a disk db 
> throughout the lifecycle of a basexhttp server?
> Application level cacheing of (possibly distributed) dbs or management of 
> transient volatile data items like tokens are the scenarios I have in mind.
> Just wondering whether this makes any sense. Whether it's feasible or whether 
> someone already did this with other means.
> Thanks a lot!
> Marco.


Re: [basex-talk] Applicative Cache

2015-11-20 Thread Christian Grün
Hi Fabrice, hi Marco,

> But I tested it again with 8.3, and did not succeed in sharing a server side 
> mainmem db.

True! I have reintroduced that feature in the latest snapshot [1].
Spontaneously, I would say there’s currently no way to realize this
for web applications. I could add the -c flag for BaseXHTTP as well.
@Marco: Do you think this would be helpful?

Please note that it’s not possible to open existing databases in main
memory [2]..

Christian

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


On Mon, Nov 9, 2015 at 5:08 PM, Etanchaud Fabrice
 wrote:
> Hi Marco,
>
> I did a few tests in that configuration last year (not with 8.X version),
> And it worked, as long as I did not "OPEN" another database.
>
> Server :
>
> java -cp "%CP%" %BASEX_JVM% org.basex.BaseXServer %* -c"SET MAINMEM 
> TRUE;CREATE DB mainmem"
>
> Client :
>
>> xquery db:open('mainmem')
> Stopped at ., 1/9:
> [bxerr:BXDB0002] Database 'mainmem' was not found.
>
> Best regards,
> Fabrice
>
> -Message d'origine-
> De : basex-talk-boun...@mailman.uni-konstanz.de 
> [mailto:basex-talk-boun...@mailman.uni-konstanz.de] De la part de Marco 
> Lettere
> Envoyé : lundi 9 novembre 2015 16:29
> À : BaseX 
> Objet : [basex-talk] Applicative Cache
>
> Hi all,
> I went though the emails talking about mainmemory databases and related but 
> I've not been able to find an answer to this loud thinking ...
> Would it be possible to create an in memory database with a RESTXQ call and 
> keep it accessible for other RESTXQ invocations as if it was a disk db 
> throughout the lifecycle of a basexhttp server?
> Application level cacheing of (possibly distributed) dbs or management of 
> transient volatile data items like tokens are the scenarios I have in mind.
> Just wondering whether this makes any sense. Whether it's feasible or whether 
> someone already did this with other means.
> Thanks a lot!
> Marco.


Re: [basex-talk] Applicative Cache

2015-11-09 Thread Etanchaud Fabrice
Hi Marco,

I did a few tests in that configuration last year (not with 8.X version),
And it worked, as long as I did not "OPEN" another database.
But I tested it again with 8.3, and did not succeed in sharing a server side 
mainmem db.

Server :

java -cp "%CP%" %BASEX_JVM% org.basex.BaseXServer %* -c"SET MAINMEM TRUE;CREATE 
DB mainmem"

Client :

> xquery db:open('mainmem')
Stopped at ., 1/9:
[bxerr:BXDB0002] Database 'mainmem' was not found.

Best regards,
Fabrice

-Message d'origine-
De : basex-talk-boun...@mailman.uni-konstanz.de 
[mailto:basex-talk-boun...@mailman.uni-konstanz.de] De la part de Marco Lettere
Envoyé : lundi 9 novembre 2015 16:29
À : BaseX 
Objet : [basex-talk] Applicative Cache

Hi all,
I went though the emails talking about mainmemory databases and related but 
I've not been able to find an answer to this loud thinking ...
Would it be possible to create an in memory database with a RESTXQ call and 
keep it accessible for other RESTXQ invocations as if it was a disk db 
throughout the lifecycle of a basexhttp server?
Application level cacheing of (possibly distributed) dbs or management of 
transient volatile data items like tokens are the scenarios I have in mind.
Just wondering whether this makes any sense. Whether it's feasible or whether 
someone already did this with other means.
Thanks a lot!
Marco.


[basex-talk] Applicative Cache

2015-11-09 Thread Marco Lettere

Hi all,
I went though the emails talking about mainmemory databases and related 
but I've not been able to find an answer to this loud thinking ...
Would it be possible to create an in memory database with a RESTXQ call 
and keep it accessible for other RESTXQ invocations as if it was a disk 
db throughout the lifecycle of a basexhttp server?
Application level cacheing of (possibly distributed) dbs or management 
of transient volatile data items like tokens are the scenarios I have in 
mind.
Just wondering whether this makes any sense. Whether it's feasible or 
whether someone already did this with other means.

Thanks a lot!
Marco.