Hi BaseX community,
I'm wondering whether there is the possibility to keep some kind of in-memory state among successive RestXQ invocations.
I know I could use the session object but this comes at the risk of loosing the state at session expiration.
I could of course use a DB but with this solution I'm not sure that paying the overhead of accessing a database is worth for the small checks I need to perform.
I was thinking of using Java and create some sort of singleton but this would introduce an unnecessary dependency from a custom jar.
Maybe with the Jobs module? Any other clue?
Thanks,
Marco.
Hi Marco,
Sessions and databases is definitely what I would recommend here. Alternatively, could also store data to files on disk. If you need to store user data, user:update-info and user:info would be additional choices.
Reports from other users are welcome. Christian
Am 04.02.2017 7:30 nachm. schrieb "Marco Lettere" m.lettere@gmail.com:
Hi BaseX community,
I'm wondering whether there is the possibility to keep some kind of in-memory state among successive RestXQ invocations.
I know I could use the session object but this comes at the risk of loosing the state at session expiration.
I could of course use a DB but with this solution I'm not sure that paying the overhead of accessing a database is worth for the small checks I need to perform.
I was thinking of using Java and create some sort of singleton but this would introduce an unnecessary dependency from a custom jar.
Maybe with the Jobs module? Any other clue?
Thanks,
Marco.
As, by definition, REST suppose without server-side states, I’m not sure about the constitance of introducing states in RESTXQ. http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm
Best regards, Emmanuel
Le 4 févr. 2017 à 13:35, Christian Grün christian.gruen@gmail.com a écrit :
Hi Marco,
Sessions and databases is definitely what I would recommend here. Alternatively, could also store data to files on disk. If you need to store user data, user:update-info and user:info would be additional choices.
Reports from other users are welcome. Christian
Am 04.02.2017 7:30 nachm. schrieb "Marco Lettere" <m.lettere@gmail.com mailto:m.lettere@gmail.com>: Hi BaseX community,
I'm wondering whether there is the possibility to keep some kind of in-memory state among successive RestXQ invocations.
I know I could use the session object but this comes at the risk of loosing the state at session expiration.
I could of course use a DB but with this solution I'm not sure that paying the overhead of accessing a database is worth for the small checks I need to perform.
I was thinking of using Java and create some sort of singleton but this would introduce an unnecessary dependency from a custom jar.
Maybe with the Jobs module? Any other clue?
Thanks,
Marco.
basex-talk@mailman.uni-konstanz.de