Hi Antonio
The BaseX home directory is static and will only be assigned once (see
[1] for more information). You should have more success by assigning a
directory to "org.basex.dbpath", but it's better to directly assign a
new path to the context:
Context context = new Context(false);
context.soptions.set(StaticOptions.DBPATH, "/mnt/test/db_1");
...
Hope this helps,
Christian
[1] https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/util/Prop.java#L99
On Tue, Oct 27, 2015 at 12:00 PM, Antonio Mele <amele@altereos.com> wrote:
> Hello,
>
> I am using basex version 8.3-SNAPSHOT in a java stand alone application.
> After i set the property org.basex.path with the path of my DB (ex.
> /mnt/test/db_1) I call a new Context and then CreateDB.
> It creates the folder /mnt/test/db_1/data/db_1
> After that (in the same execution enviroment) I change the property to
> another DB (ex. /mnt/test/db_2).
> It creates the folder /mnt/test/db_1/data/db_2
>
> I would like to create the db_2 in the path /mnt/test/db_2/data/db_2.
>
>
> Follow the code I wrote, where inputFolder is a folder with inside some xml
> files
>
>
> Thanks in advance.
>
>
> System.setProperty("org.basex.path", "/mnt/test/db_1");
> Context context = new Context(false);
> new CreateDB("db_1", inputFolder).execute(context);
> context.close();
>
> System.setProperty("org.basex.path", "/mnt/test/db_2");
> context = new Context(false);
> new CreateDB("db_2", inputFolder).execute(context);
> context.close();