Testing one data directory per tenant

Monday, 14 November 2016 · 2 messages
MG
Maximilian Gärber14 Nov 2016 21:09 #
Hi, I am testing how to change DBPATH dynamically to enable a simple form of multi tenancy (running one basex instance with separated data directories, so locking for example does not affect all tenants). Basically, I just keep/reuse several Context objects which have other options set [1]
String dbpath =  ctx.soptions.get(StaticOptions.DBPATH);
String userDbPath = dbpath + "\\" + usr;
ctx.soptions.put(StaticOptions.DBPATH, userDbPath);
So far, I did not experience any issues, anything that speaks against doing this? Regards, Max [1] https://github.com/axxepta/basex-multitenant/blob/master/src/test/java/de/axxepta/basex/AppTest.java
CG
Christian Grün14 Nov 2016 21:12 #
Interesting experiments.. I didn't try it by myself, so I'd say it's one of those "works 95%" solutions ;) Maybe even 99%. Keep me updated! Christian
Quoted text · Maximilian Gärber · 26 lines
Am 14.11.2016 9:09 nachm. schrieb "Maximilian Gärber" <mgaerber at arcor.de>: > Hi, > > I am testing how to change DBPATH dynamically to enable a simple form > of multi tenancy (running one basex instance with separated data > directories, so locking for example does not affect all tenants). > > Basically, I just keep/reuse several Context objects which have other > options set [1] > > String dbpath = ctx.soptions.get(StaticOptions.DBPATH); > String userDbPath = dbpath + "\\" + usr; > ctx.soptions.put(StaticOptions.DBPATH, userDbPath); > > So far, I did not experience any issues, anything that speaks against > doing this? > > > Regards, > > Max > > > [1] https://github.com/axxepta/basex-multitenant/blob/master/ > src/test/java/de/axxepta/basex/AppTest.java >

⚡Generated with XQuery